Lines Matching full:hd
44 struct hd44780 *hd = hdc->hd44780; in hd44780_backlight() local
46 if (hd->pins[PIN_CTRL_BL]) in hd44780_backlight()
47 gpiod_set_value_cansleep(hd->pins[PIN_CTRL_BL], on); in hd44780_backlight()
50 static void hd44780_strobe_gpio(struct hd44780 *hd) in hd44780_strobe_gpio() argument
55 gpiod_set_value_cansleep(hd->pins[PIN_CTRL_E], 1); in hd44780_strobe_gpio()
60 gpiod_set_value_cansleep(hd->pins[PIN_CTRL_E], 0); in hd44780_strobe_gpio()
64 static void hd44780_write_gpio8(struct hd44780 *hd, u8 val, unsigned int rs) in hd44780_write_gpio8() argument
71 n = hd->pins[PIN_CTRL_RW] ? 10 : 9; in hd44780_write_gpio8()
74 gpiod_set_array_value_cansleep(n, &hd->pins[PIN_DATA0], NULL, values); in hd44780_write_gpio8()
76 hd44780_strobe_gpio(hd); in hd44780_write_gpio8()
80 static void hd44780_write_gpio4(struct hd44780 *hd, u8 val, unsigned int rs) in hd44780_write_gpio4() argument
88 n = hd->pins[PIN_CTRL_RW] ? 6 : 5; in hd44780_write_gpio4()
91 gpiod_set_array_value_cansleep(n, &hd->pins[PIN_DATA4], NULL, values); in hd44780_write_gpio4()
93 hd44780_strobe_gpio(hd); in hd44780_write_gpio4()
100 gpiod_set_array_value_cansleep(n, &hd->pins[PIN_DATA4], NULL, values); in hd44780_write_gpio4()
102 hd44780_strobe_gpio(hd); in hd44780_write_gpio4()
108 struct hd44780 *hd = hdc->hd44780; in hd44780_write_cmd_gpio8() local
110 hd44780_write_gpio8(hd, cmd, 0); in hd44780_write_cmd_gpio8()
119 struct hd44780 *hd = hdc->hd44780; in hd44780_write_data_gpio8() local
121 hd44780_write_gpio8(hd, data, 1); in hd44780_write_data_gpio8()
147 struct hd44780 *hd = hdc->hd44780; in hd44780_write_cmd_gpio4() local
149 hd44780_write_gpio4(hd, cmd, 0); in hd44780_write_cmd_gpio4()
159 struct hd44780 *hd = hdc->hd44780; in hd44780_write_cmd_raw_gpio4() local
164 n = hd->pins[PIN_CTRL_RW] ? 6 : 5; in hd44780_write_cmd_raw_gpio4()
167 gpiod_set_array_value_cansleep(n, &hd->pins[PIN_DATA4], NULL, values); in hd44780_write_cmd_raw_gpio4()
169 hd44780_strobe_gpio(hd); in hd44780_write_cmd_raw_gpio4()
175 struct hd44780 *hd = hdc->hd44780; in hd44780_write_data_gpio4() local
177 hd44780_write_gpio4(hd, data, 1); in hd44780_write_data_gpio4()
206 struct hd44780 *hd; in hd44780_probe() local
233 hd = kzalloc(sizeof(*hd), GFP_KERNEL); in hd44780_probe()
234 if (!hd) in hd44780_probe()
237 hdc->hd44780 = hd; in hd44780_probe()
240 hd->pins[base + i] = devm_gpiod_get_index(dev, "data", i, in hd44780_probe()
242 if (IS_ERR(hd->pins[base + i])) { in hd44780_probe()
243 ret = PTR_ERR(hd->pins[base + i]); in hd44780_probe()
248 hd->pins[PIN_CTRL_E] = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); in hd44780_probe()
249 if (IS_ERR(hd->pins[PIN_CTRL_E])) { in hd44780_probe()
250 ret = PTR_ERR(hd->pins[PIN_CTRL_E]); in hd44780_probe()
254 hd->pins[PIN_CTRL_RS] = devm_gpiod_get(dev, "rs", GPIOD_OUT_HIGH); in hd44780_probe()
255 if (IS_ERR(hd->pins[PIN_CTRL_RS])) { in hd44780_probe()
256 ret = PTR_ERR(hd->pins[PIN_CTRL_RS]); in hd44780_probe()
261 hd->pins[PIN_CTRL_RW] = devm_gpiod_get_optional(dev, "rw", in hd44780_probe()
263 if (IS_ERR(hd->pins[PIN_CTRL_RW])) { in hd44780_probe()
264 ret = PTR_ERR(hd->pins[PIN_CTRL_RW]); in hd44780_probe()
268 hd->pins[PIN_CTRL_BL] = devm_gpiod_get_optional(dev, "backlight", in hd44780_probe()
270 if (IS_ERR(hd->pins[PIN_CTRL_BL])) { in hd44780_probe()
271 ret = PTR_ERR(hd->pins[PIN_CTRL_BL]); in hd44780_probe()
314 kfree(hd); in hd44780_probe()