Lines Matching refs:uc_priv
31 struct gpio_dev_priv *uc_priv; in gpio_to_device() local
38 uc_priv = dev_get_uclass_priv(dev); in gpio_to_device()
39 if (gpio >= uc_priv->gpio_base && in gpio_to_device()
40 gpio < uc_priv->gpio_base + uc_priv->gpio_count) { in gpio_to_device()
42 desc->offset = gpio - uc_priv->gpio_base; in gpio_to_device()
54 struct gpio_dev_priv *uc_priv = NULL; in dm_gpio_lookup_name() local
66 uc_priv = dev_get_uclass_priv(dev); in dm_gpio_lookup_name()
68 offset = numeric - uc_priv->gpio_base; in dm_gpio_lookup_name()
70 if (offset < uc_priv->gpio_count) in dm_gpio_lookup_name()
74 len = uc_priv->bank_name ? strlen(uc_priv->bank_name) : 0; in dm_gpio_lookup_name()
76 if (!strncasecmp(name, uc_priv->bank_name, len)) { in dm_gpio_lookup_name()
108 struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(desc.dev); in gpio_lookup_name() local
110 *gpiop = uc_priv->gpio_base + desc.offset; in gpio_lookup_name()
147 struct gpio_dev_priv *uc_priv; in dm_gpio_request() local
151 uc_priv = dev_get_uclass_priv(dev); in dm_gpio_request()
152 if (uc_priv->name[desc->offset]) in dm_gpio_request()
164 uc_priv->name[desc->offset] = str; in dm_gpio_request()
235 struct gpio_dev_priv *uc_priv; in _dm_gpio_free() local
238 uc_priv = dev_get_uclass_priv(dev); in _dm_gpio_free()
239 if (!uc_priv->name[offset]) in _dm_gpio_free()
247 free(uc_priv->name[offset]); in _dm_gpio_free()
248 uc_priv->name[offset] = NULL; in _dm_gpio_free()
275 struct gpio_dev_priv *uc_priv; in check_reserved() local
280 uc_priv = dev_get_uclass_priv(desc->dev); in check_reserved()
281 if (!uc_priv->name[desc->offset]) { in check_reserved()
284 uc_priv->bank_name ? uc_priv->bank_name : "", in check_reserved()
499 struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); in get_function() local
505 if (offset < 0 || offset >= uc_priv->gpio_count) in get_function()
508 *namep = uc_priv->name[offset]; in get_function()
509 if (skip_unused && !uc_priv->name[offset]) in get_function()
797 struct gpio_dev_priv *uc_priv; in gpio_renumber() local
811 uc_priv = dev_get_uclass_priv(dev); in gpio_renumber()
812 uc_priv->gpio_base = base; in gpio_renumber()
813 base += uc_priv->gpio_count; in gpio_renumber()
823 struct gpio_dev_priv *uc_priv; in gpio_get_number() local
827 uc_priv = dev->uclass_priv; in gpio_get_number()
829 return uc_priv->gpio_base + desc->offset; in gpio_get_number()
834 struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); in gpio_post_probe() local
836 uc_priv->name = calloc(uc_priv->gpio_count, sizeof(char *)); in gpio_post_probe()
837 if (!uc_priv->name) in gpio_post_probe()
845 struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); in gpio_pre_remove() local
848 for (i = 0; i < uc_priv->gpio_count; i++) { in gpio_pre_remove()
849 if (uc_priv->name[i]) in gpio_pre_remove()
850 free(uc_priv->name[i]); in gpio_pre_remove()
852 free(uc_priv->name); in gpio_pre_remove()