Lines Matching refs:hd

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