Lines Matching refs:hd

42 	struct hd44780 *hd = lcd->drvdata;
44 if (hd->pins[PIN_CTRL_BL])
45 gpiod_set_value_cansleep(hd->pins[PIN_CTRL_BL], on);
48 static void hd44780_strobe_gpio(struct hd44780 *hd)
53 gpiod_set_value_cansleep(hd->pins[PIN_CTRL_E], 1);
58 gpiod_set_value_cansleep(hd->pins[PIN_CTRL_E], 0);
62 static void hd44780_write_gpio8(struct hd44780 *hd, u8 val, unsigned int rs)
69 n = hd->pins[PIN_CTRL_RW] ? 10 : 9;
72 gpiod_set_array_value_cansleep(n, &hd->pins[PIN_DATA0], NULL, values);
74 hd44780_strobe_gpio(hd);
78 static void hd44780_write_gpio4(struct hd44780 *hd, u8 val, unsigned int rs)
86 n = hd->pins[PIN_CTRL_RW] ? 6 : 5;
89 gpiod_set_array_value_cansleep(n, &hd->pins[PIN_DATA4], NULL, values);
91 hd44780_strobe_gpio(hd);
98 gpiod_set_array_value_cansleep(n, &hd->pins[PIN_DATA4], NULL, values);
100 hd44780_strobe_gpio(hd);
106 struct hd44780 *hd = lcd->drvdata;
108 hd44780_write_gpio8(hd, cmd, 0);
117 struct hd44780 *hd = lcd->drvdata;
119 hd44780_write_gpio8(hd, data, 1);
134 struct hd44780 *hd = lcd->drvdata;
136 hd44780_write_gpio4(hd, cmd, 0);
146 struct hd44780 *hd = lcd->drvdata;
151 n = hd->pins[PIN_CTRL_RW] ? 6 : 5;
154 gpiod_set_array_value_cansleep(n, &hd->pins[PIN_DATA4], NULL, values);
156 hd44780_strobe_gpio(hd);
162 struct hd44780 *hd = lcd->drvdata;
164 hd44780_write_gpio4(hd, data, 1);
182 struct hd44780 *hd;
205 hd = lcd->drvdata;
208 hd->pins[base + i] = devm_gpiod_get_index(dev, "data", i,
210 if (IS_ERR(hd->pins[base + i])) {
211 ret = PTR_ERR(hd->pins[base + i]);
216 hd->pins[PIN_CTRL_E] = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
217 if (IS_ERR(hd->pins[PIN_CTRL_E])) {
218 ret = PTR_ERR(hd->pins[PIN_CTRL_E]);
222 hd->pins[PIN_CTRL_RS] = devm_gpiod_get(dev, "rs", GPIOD_OUT_HIGH);
223 if (IS_ERR(hd->pins[PIN_CTRL_RS])) {
224 ret = PTR_ERR(hd->pins[PIN_CTRL_RS]);
229 hd->pins[PIN_CTRL_RW] = devm_gpiod_get_optional(dev, "rw",
231 if (IS_ERR(hd->pins[PIN_CTRL_RW])) {
232 ret = PTR_ERR(hd->pins[PIN_CTRL_RW]);
236 hd->pins[PIN_CTRL_BL] = devm_gpiod_get_optional(dev, "backlight",
238 if (IS_ERR(hd->pins[PIN_CTRL_BL])) {
239 ret = PTR_ERR(hd->pins[PIN_CTRL_BL]);