Lines Matching full:community

130 #define for_each_intel_pin_community(pctrl, community)					\  argument
132 __ci < pctrl->ncommunities && (community = &pctrl->communities[__ci]); \
135 #define for_each_intel_community_pad_group(community, grp) \ argument
137 __gi < community->ngpps && (grp = &community->gpps[__gi]); \
140 #define for_each_intel_pad_group(pctrl, community, grp) \ argument
141 for_each_intel_pin_community(pctrl, community) \
142 for_each_intel_community_pad_group(community, grp)
144 #define for_each_intel_gpio_group(pctrl, community, grp) \ argument
145 for_each_intel_pad_group(pctrl, community, grp) \
151 const struct intel_community *community; in intel_get_community() local
153 for_each_intel_pin_community(pctrl, community) { in intel_get_community()
154 if (pin >= community->pin_base && in intel_get_community()
155 pin < community->pin_base + community->npins) in intel_get_community()
156 return community; in intel_get_community()
159 dev_warn(pctrl->dev, "failed to find community for pin %u\n", pin); in intel_get_community()
165 intel_community_get_padgroup(const struct intel_community *community, in intel_community_get_padgroup() argument
170 for_each_intel_community_pad_group(community, padgrp) { in intel_community_get_padgroup()
181 const struct intel_community *community; in intel_get_padcfg() local
185 community = intel_get_community(pctrl, pin); in intel_get_padcfg()
186 if (!community) in intel_get_padcfg()
189 padno = pin_to_padno(community, pin); in intel_get_padcfg()
190 nregs = (community->features & PINCTRL_FEATURE_DEBOUNCE) ? 4 : 2; in intel_get_padcfg()
195 return community->pad_regs + reg + padno * nregs * 4; in intel_get_padcfg()
200 const struct intel_community *community; in intel_pad_owned_by_host() local
205 community = intel_get_community(pctrl, pin); in intel_pad_owned_by_host()
206 if (!community) in intel_pad_owned_by_host()
208 if (!community->padown_offset) in intel_pad_owned_by_host()
211 padgrp = intel_community_get_padgroup(community, pin); in intel_pad_owned_by_host()
217 offset = community->padown_offset + padgrp->padown_num * 4 + gpp * 4; in intel_pad_owned_by_host()
218 padown = community->regs + offset; in intel_pad_owned_by_host()
225 const struct intel_community *community; in intel_pad_acpi_mode() local
230 community = intel_get_community(pctrl, pin); in intel_pad_acpi_mode()
231 if (!community) in intel_pad_acpi_mode()
233 if (!community->hostown_offset) in intel_pad_acpi_mode()
236 padgrp = intel_community_get_padgroup(community, pin); in intel_pad_acpi_mode()
241 offset = community->hostown_offset + padgrp->reg_num * 4; in intel_pad_acpi_mode()
242 hostown = community->regs + offset; in intel_pad_acpi_mode()
267 const struct intel_community *community; in intel_pad_locked() local
273 community = intel_get_community(pctrl, pin); in intel_pad_locked()
274 if (!community) in intel_pad_locked()
276 if (!community->padcfglock_offset) in intel_pad_locked()
279 padgrp = intel_community_get_padgroup(community, pin); in intel_pad_locked()
290 offset = community->padcfglock_offset + 0 + padgrp->reg_num * 8; in intel_pad_locked()
291 value = readl(community->regs + offset); in intel_pad_locked()
295 offset = community->padcfglock_offset + 4 + padgrp->reg_num * 8; in intel_pad_locked()
296 value = readl(community->regs + offset); in intel_pad_locked()
646 const struct intel_community *community = intel_get_community(pctrl, pin); in intel_config_get_pull() local
653 if (!(community->features & PINCTRL_FEATURE_1K_PD)) in intel_config_get_pull()
658 if (!(community->features & PINCTRL_FEATURE_1K_PD)) in intel_config_get_pull()
801 const struct intel_community *community = intel_get_community(pctrl, pin); in intel_config_set_pull() local
815 if (!(community->features & PINCTRL_FEATURE_1K_PD)) in intel_config_set_pull()
820 if (!(community->features & PINCTRL_FEATURE_1K_PD)) in intel_config_set_pull()
959 * @community: Community is filled here if not %NULL
966 * Return: a pin number and pointers to the community and pad group, which
970 const struct intel_community **community, in intel_gpio_to_pin() argument
978 if (community) in intel_gpio_to_pin()
979 *community = comm; in intel_gpio_to_pin()
1001 const struct intel_community *community; in intel_pin_to_gpio() local
1004 community = intel_get_community(pctrl, pin); in intel_pin_to_gpio()
1005 if (!community) in intel_pin_to_gpio()
1008 padgrp = intel_community_get_padgroup(community, pin); in intel_pin_to_gpio()
1125 const struct intel_community *community; in intel_gpio_irq_ack() local
1129 pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), &community, &padgrp); in intel_gpio_irq_ack()
1137 is = community->regs + community->is_offset + gpp * 4; in intel_gpio_irq_ack()
1148 const struct intel_community *community; in intel_gpio_irq_mask_unmask() local
1152 pin = intel_gpio_to_pin(pctrl, hwirq, &community, &padgrp); in intel_gpio_irq_mask_unmask()
1161 reg = community->regs + community->ie_offset + gpp * 4; in intel_gpio_irq_mask_unmask()
1162 is = community->regs + community->is_offset + gpp * 4; in intel_gpio_irq_mask_unmask()
1282 const struct intel_community *community; in intel_gpio_irq() local
1288 for_each_intel_pad_group(pctrl, community, padgrp) { in intel_gpio_irq()
1296 reg = community->regs + community->ie_offset + gpp * 4; in intel_gpio_irq()
1297 is = community->regs + community->is_offset + gpp * 4; in intel_gpio_irq()
1318 const struct intel_community *community; in intel_gpio_irq_init() local
1320 for_each_intel_pin_community(pctrl, community) { in intel_gpio_irq_init()
1324 for (gpp = 0; gpp < community->ngpps; gpp++) { in intel_gpio_irq_init()
1325 reg = community->regs + community->ie_offset + gpp * 4; in intel_gpio_irq_init()
1326 is = community->regs + community->is_offset + gpp * 4; in intel_gpio_irq_init()
1351 const struct intel_community *community; in intel_gpio_add_pin_ranges() local
1355 for_each_intel_gpio_group(pctrl, community, grp) { in intel_gpio_add_pin_ranges()
1370 const struct intel_community *community; in intel_gpio_ngpio() local
1374 for_each_intel_gpio_group(pctrl, community, grp) { in intel_gpio_ngpio()
1429 struct intel_community *community) in intel_pinctrl_add_padgroups_by_gpps() argument
1433 size_t i, ngpps = community->ngpps; in intel_pinctrl_add_padgroups_by_gpps()
1440 gpps[i] = community->gpps[i]; in intel_pinctrl_add_padgroups_by_gpps()
1463 community->gpps = gpps; in intel_pinctrl_add_padgroups_by_gpps()
1469 struct intel_community *community) in intel_pinctrl_add_padgroups_by_size() argument
1472 unsigned int npins = community->npins; in intel_pinctrl_add_padgroups_by_size()
1474 size_t i, ngpps = DIV_ROUND_UP(npins, community->gpp_size); in intel_pinctrl_add_padgroups_by_size()
1476 if (community->gpp_size > INTEL_PINCTRL_MAX_GPP_SIZE) in intel_pinctrl_add_padgroups_by_size()
1484 unsigned int gpp_size = community->gpp_size; in intel_pinctrl_add_padgroups_by_size()
1487 gpps[i].base = community->pin_base + i * gpp_size; in intel_pinctrl_add_padgroups_by_size()
1494 padown_num += community->gpp_num_padown_regs; in intel_pinctrl_add_padgroups_by_size()
1497 community->ngpps = ngpps; in intel_pinctrl_add_padgroups_by_size()
1498 community->gpps = gpps; in intel_pinctrl_add_padgroups_by_size()
1522 struct intel_community *community = &pctrl->communities[i]; in intel_pinctrl_pm_init() local
1525 intmask = devm_kcalloc(pctrl->dev, community->ngpps, in intel_pinctrl_pm_init()
1532 hostown = devm_kcalloc(pctrl->dev, community->ngpps, in intel_pinctrl_pm_init()
1548 struct intel_community *community) in intel_pinctrl_probe_pwm() argument
1557 if (!(community->features & PINCTRL_FEATURE_PWM)) in intel_pinctrl_probe_pwm()
1563 chip = devm_pwm_lpss_probe(pctrl->dev, community->regs + PWMC, &info); in intel_pinctrl_probe_pwm()
1593 struct intel_community *community = &pctrl->communities[i]; in intel_pinctrl_probe() local
1598 regs = devm_platform_ioremap_resource(pdev, community->barno); in intel_pinctrl_probe()
1603 * Determine community features based on the revision. in intel_pinctrl_probe()
1610 community->features |= PINCTRL_FEATURE_DEBOUNCE; in intel_pinctrl_probe()
1611 community->features |= PINCTRL_FEATURE_1K_PD; in intel_pinctrl_probe()
1614 /* Determine community features based on the capabilities */ in intel_pinctrl_probe()
1620 community->features |= PINCTRL_FEATURE_GPIO_HW_INFO; in intel_pinctrl_probe()
1623 community->features |= PINCTRL_FEATURE_PWM; in intel_pinctrl_probe()
1626 community->features |= PINCTRL_FEATURE_BLINK; in intel_pinctrl_probe()
1629 community->features |= PINCTRL_FEATURE_EXP; in intel_pinctrl_probe()
1637 dev_dbg(dev, "Community%d features: %#08x\n", i, community->features); in intel_pinctrl_probe()
1642 community->regs = regs; in intel_pinctrl_probe()
1643 community->pad_regs = regs + offset; in intel_pinctrl_probe()
1645 if (community->gpps) in intel_pinctrl_probe()
1646 ret = intel_pinctrl_add_padgroups_by_gpps(pctrl, community); in intel_pinctrl_probe()
1648 ret = intel_pinctrl_add_padgroups_by_size(pctrl, community); in intel_pinctrl_probe()
1652 ret = intel_pinctrl_probe_pwm(pctrl, community); in intel_pinctrl_probe()
1815 struct intel_community *community = &pctrl->communities[i]; in intel_pinctrl_suspend_noirq() local
1819 base = community->regs + community->ie_offset; in intel_pinctrl_suspend_noirq()
1820 for (gpp = 0; gpp < community->ngpps; gpp++) in intel_pinctrl_suspend_noirq()
1823 base = community->regs + community->hostown_offset; in intel_pinctrl_suspend_noirq()
1824 for (gpp = 0; gpp < community->ngpps; gpp++) in intel_pinctrl_suspend_noirq()
1848 const struct intel_community *community = &pctrl->communities[c]; in intel_restore_hostown() local
1849 const struct intel_padgroup *padgrp = &community->gpps[gpp]; in intel_restore_hostown()
1925 struct intel_community *community = &pctrl->communities[i]; in intel_pinctrl_resume_noirq() local
1929 base = community->regs + community->ie_offset; in intel_pinctrl_resume_noirq()
1930 for (gpp = 0; gpp < community->ngpps; gpp++) in intel_pinctrl_resume_noirq()
1933 base = community->regs + community->hostown_offset; in intel_pinctrl_resume_noirq()
1934 for (gpp = 0; gpp < community->ngpps; gpp++) in intel_pinctrl_resume_noirq()