Lines Matching +full:first +full:- +full:data +full:- +full:gpios
4 * SPDX-License-Identifier: GPL-2.0+
12 #include <dm-demo.h>
23 int num_chars; /* Number of non-space characters output so far */
32 struct shape_data *data = dev_get_priv(dev); in shape_hello() local
41 { HEIGHT / 2 - 1, WIDTH - HEIGHT / 2 + 1, -1, 1}, in shape_hello()
46 const char *colour = pdata->colour; in shape_hello()
47 int first = 0; in shape_hello() local
50 ch = pdata->default_char; in shape_hello()
54 index = (pdata->sides / 2) - 1; in shape_hello()
56 return -EIO; in shape_hello()
60 first = 1; in shape_hello()
64 putc(first ? *colour++ : ch); in shape_hello()
65 data->num_chars++; in shape_hello()
66 first = 0; in shape_hello()
68 colour = pdata->colour; in shape_hello()
77 shape.dstart = -shape.dstart; in shape_hello()
78 shape.dend = -shape.dend; in shape_hello()
89 struct shape_data *data = dev_get_priv(dev); in shape_status() local
91 *status = data->num_chars; in shape_status()
102 desc = priv->gpio_desc; in set_light()
103 for (i = 0; i < priv->gpio_count; i++, desc++) { in set_light()
122 desc = priv->gpio_desc; in get_light()
123 for (i = 0; i < priv->gpio_count; i++, desc++) { in get_light()
148 /* Parse the data that is common with all demo devices */ in shape_ofdata_to_platdata()
153 /* Parse the data that only we need */ in shape_ofdata_to_platdata()
154 pdata->default_char = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), in shape_ofdata_to_platdata()
165 ret = gpio_request_list_by_name(dev, "light-gpios", priv->gpio_desc, in dm_shape_probe()
166 ARRAY_SIZE(priv->gpio_desc), in dm_shape_probe()
170 priv->gpio_count = ret; in dm_shape_probe()
171 debug("%s: %d GPIOs\n", __func__, priv->gpio_count); in dm_shape_probe()
180 return gpio_free_list(dev, priv->gpio_desc, priv->gpio_count); in dm_shape_remove()
184 { "demo-shape", 0 },