Lines Matching +full:child +full:- +full:interrupt +full:- +full:base

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2021-2023, Intel Corporation
18 #include "pinctrl-intel.h"
25 static int intel_platform_pinctrl_prepare_pins(struct device *dev, size_t base, in intel_platform_pinctrl_prepare_pins() argument
37 descs = devm_krealloc_array(dev, pins->pins, base + size, sizeof(*descs), GFP_KERNEL); in intel_platform_pinctrl_prepare_pins()
39 return -ENOMEM; in intel_platform_pinctrl_prepare_pins()
42 unsigned int pin_number = base + i; in intel_platform_pinctrl_prepare_pins()
47 strreplace(pin_name, '-', '_'); in intel_platform_pinctrl_prepare_pins()
50 desc->number = pin_number; in intel_platform_pinctrl_prepare_pins()
51 desc->name = pin_name; in intel_platform_pinctrl_prepare_pins()
54 pins->pins = descs; in intel_platform_pinctrl_prepare_pins()
55 pins->npins = base + size; in intel_platform_pinctrl_prepare_pins()
61 struct fwnode_handle *child, in intel_platform_pinctrl_prepare_group() argument
65 size_t base = pins->npins; in intel_platform_pinctrl_prepare_group() local
70 ret = fwnode_property_read_string(child, "intc-gpio-group-name", &name); in intel_platform_pinctrl_prepare_group()
74 ret = fwnode_property_read_u32(child, "intc-gpio-pad-count", &size); in intel_platform_pinctrl_prepare_group()
78 ret = intel_platform_pinctrl_prepare_pins(dev, base, name, size, pins); in intel_platform_pinctrl_prepare_group()
82 gpp->base = base; in intel_platform_pinctrl_prepare_group()
83 gpp->size = size; in intel_platform_pinctrl_prepare_group()
84 gpp->gpio_base = INTEL_GPIO_BASE_MATCH; in intel_platform_pinctrl_prepare_group()
99 ret = device_property_read_u32(dev, "intc-gpio-pad-ownership-offset", &offset); in intel_platform_pinctrl_prepare_community()
102 community->padown_offset = offset; in intel_platform_pinctrl_prepare_community()
104 ret = device_property_read_u32(dev, "intc-gpio-pad-configuration-lock-offset", &offset); in intel_platform_pinctrl_prepare_community()
107 community->padcfglock_offset = offset; in intel_platform_pinctrl_prepare_community()
109 ret = device_property_read_u32(dev, "intc-gpio-host-software-pad-ownership-offset", &offset); in intel_platform_pinctrl_prepare_community()
112 community->hostown_offset = offset; in intel_platform_pinctrl_prepare_community()
114 ret = device_property_read_u32(dev, "intc-gpio-gpi-interrupt-status-offset", &offset); in intel_platform_pinctrl_prepare_community()
117 community->is_offset = offset; in intel_platform_pinctrl_prepare_community()
119 ret = device_property_read_u32(dev, "intc-gpio-gpi-interrupt-enable-offset", &offset); in intel_platform_pinctrl_prepare_community()
122 community->ie_offset = offset; in intel_platform_pinctrl_prepare_community()
126 return -ENODEV; in intel_platform_pinctrl_prepare_community()
130 return -ENOMEM; in intel_platform_pinctrl_prepare_community()
133 device_for_each_child_node_scoped(dev, child) { in intel_platform_pinctrl_prepare_community()
136 gpp->reg_num = group; in intel_platform_pinctrl_prepare_community()
138 ret = intel_platform_pinctrl_prepare_group(dev, child, gpp, pins); in intel_platform_pinctrl_prepare_community()
145 community->ngpps = ngpps; in intel_platform_pinctrl_prepare_community()
146 community->gpps = gpps; in intel_platform_pinctrl_prepare_community()
164 return -ENOMEM; in intel_platform_pinctrl_prepare_soc_data()
169 community->barno = i; in intel_platform_pinctrl_prepare_soc_data()
170 community->pin_base = pins.npins; in intel_platform_pinctrl_prepare_soc_data()
176 community->npins = pins.npins - community->pin_base; in intel_platform_pinctrl_prepare_soc_data()
179 data->ncommunities = ncommunities; in intel_platform_pinctrl_prepare_soc_data()
180 data->communities = communities; in intel_platform_pinctrl_prepare_soc_data()
182 data->npins = pins.npins; in intel_platform_pinctrl_prepare_soc_data()
183 data->pins = pins.pins; in intel_platform_pinctrl_prepare_soc_data()
191 struct device *dev = &pdev->dev; in intel_platform_pinctrl_probe()
196 return -ENOMEM; in intel_platform_pinctrl_probe()
214 .name = "intel-pinctrl",