Lines Matching refs:community
117 #define for_each_intel_pin_community(pctrl, community) \ argument
119 __ci < pctrl->ncommunities && (community = &pctrl->communities[__ci]); \
122 #define for_each_intel_community_pad_group(community, grp) \ argument
124 __gi < community->ngpps && (grp = &community->gpps[__gi]); \
127 #define for_each_intel_pad_group(pctrl, community, grp) \ argument
128 for_each_intel_pin_community(pctrl, community) \
129 for_each_intel_community_pad_group(community, grp)
131 #define for_each_intel_gpio_group(pctrl, community, grp) \ argument
132 for_each_intel_pad_group(pctrl, community, grp) \
138 const struct intel_community *community; in intel_get_community() local
140 for_each_intel_pin_community(pctrl, community) { in intel_get_community()
141 if (pin >= community->pin_base && in intel_get_community()
142 pin < community->pin_base + community->npins) in intel_get_community()
143 return community; in intel_get_community()
152 intel_community_get_padgroup(const struct intel_community *community, in intel_community_get_padgroup() argument
157 for_each_intel_community_pad_group(community, padgrp) { in intel_community_get_padgroup()
168 const struct intel_community *community; in intel_get_padcfg() local
172 community = intel_get_community(pctrl, pin); in intel_get_padcfg()
173 if (!community) in intel_get_padcfg()
176 padno = pin_to_padno(community, pin); in intel_get_padcfg()
177 nregs = (community->features & PINCTRL_FEATURE_DEBOUNCE) ? 4 : 2; in intel_get_padcfg()
182 return community->pad_regs + reg + padno * nregs * 4; in intel_get_padcfg()
187 const struct intel_community *community; in intel_pad_owned_by_host() local
192 community = intel_get_community(pctrl, pin); in intel_pad_owned_by_host()
193 if (!community) in intel_pad_owned_by_host()
195 if (!community->padown_offset) in intel_pad_owned_by_host()
198 padgrp = intel_community_get_padgroup(community, pin); in intel_pad_owned_by_host()
204 offset = community->padown_offset + padgrp->padown_num * 4 + gpp * 4; in intel_pad_owned_by_host()
205 padown = community->regs + offset; in intel_pad_owned_by_host()
212 const struct intel_community *community; in intel_pad_acpi_mode() local
217 community = intel_get_community(pctrl, pin); in intel_pad_acpi_mode()
218 if (!community) in intel_pad_acpi_mode()
220 if (!community->hostown_offset) in intel_pad_acpi_mode()
223 padgrp = intel_community_get_padgroup(community, pin); in intel_pad_acpi_mode()
228 offset = community->hostown_offset + padgrp->reg_num * 4; in intel_pad_acpi_mode()
229 hostown = community->regs + offset; in intel_pad_acpi_mode()
254 const struct intel_community *community; in intel_pad_locked() local
260 community = intel_get_community(pctrl, pin); in intel_pad_locked()
261 if (!community) in intel_pad_locked()
263 if (!community->padcfglock_offset) in intel_pad_locked()
266 padgrp = intel_community_get_padgroup(community, pin); in intel_pad_locked()
277 offset = community->padcfglock_offset + 0 + padgrp->reg_num * 8; in intel_pad_locked()
278 value = readl(community->regs + offset); in intel_pad_locked()
282 offset = community->padcfglock_offset + 4 + padgrp->reg_num * 8; in intel_pad_locked()
283 value = readl(community->regs + offset); in intel_pad_locked()
633 const struct intel_community *community = intel_get_community(pctrl, pin); in intel_config_get_pull() local
640 if (!(community->features & PINCTRL_FEATURE_1K_PD)) in intel_config_get_pull()
645 if (!(community->features & PINCTRL_FEATURE_1K_PD)) in intel_config_get_pull()
788 const struct intel_community *community = intel_get_community(pctrl, pin); in intel_config_set_pull() local
802 if (!(community->features & PINCTRL_FEATURE_1K_PD)) in intel_config_set_pull()
807 if (!(community->features & PINCTRL_FEATURE_1K_PD)) in intel_config_set_pull()
957 const struct intel_community **community, in intel_gpio_to_pin() argument
965 if (community) in intel_gpio_to_pin()
966 *community = comm; in intel_gpio_to_pin()
988 const struct intel_community *community; in intel_pin_to_gpio() local
991 community = intel_get_community(pctrl, pin); in intel_pin_to_gpio()
992 if (!community) in intel_pin_to_gpio()
995 padgrp = intel_community_get_padgroup(community, pin); in intel_pin_to_gpio()
1105 const struct intel_community *community; in intel_gpio_irq_ack() local
1109 pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), &community, &padgrp); in intel_gpio_irq_ack()
1117 is = community->regs + community->is_offset + gpp * 4; in intel_gpio_irq_ack()
1128 const struct intel_community *community; in intel_gpio_irq_mask_unmask() local
1132 pin = intel_gpio_to_pin(pctrl, hwirq, &community, &padgrp); in intel_gpio_irq_mask_unmask()
1141 reg = community->regs + community->ie_offset + gpp * 4; in intel_gpio_irq_mask_unmask()
1142 is = community->regs + community->is_offset + gpp * 4; in intel_gpio_irq_mask_unmask()
1262 const struct intel_community *community; in intel_gpio_irq() local
1268 for_each_intel_pad_group(pctrl, community, padgrp) { in intel_gpio_irq()
1276 reg = community->regs + community->ie_offset + gpp * 4; in intel_gpio_irq()
1277 is = community->regs + community->is_offset + gpp * 4; in intel_gpio_irq()
1298 const struct intel_community *community; in intel_gpio_irq_init() local
1300 for_each_intel_pin_community(pctrl, community) { in intel_gpio_irq_init()
1304 for (gpp = 0; gpp < community->ngpps; gpp++) { in intel_gpio_irq_init()
1305 reg = community->regs + community->ie_offset + gpp * 4; in intel_gpio_irq_init()
1306 is = community->regs + community->is_offset + gpp * 4; in intel_gpio_irq_init()
1331 const struct intel_community *community; in intel_gpio_add_pin_ranges() local
1335 for_each_intel_gpio_group(pctrl, community, grp) { in intel_gpio_add_pin_ranges()
1350 const struct intel_community *community; in intel_gpio_ngpio() local
1354 for_each_intel_gpio_group(pctrl, community, grp) { in intel_gpio_ngpio()
1409 struct intel_community *community) in intel_pinctrl_add_padgroups_by_gpps() argument
1413 size_t i, ngpps = community->ngpps; in intel_pinctrl_add_padgroups_by_gpps()
1420 gpps[i] = community->gpps[i]; in intel_pinctrl_add_padgroups_by_gpps()
1443 community->gpps = gpps; in intel_pinctrl_add_padgroups_by_gpps()
1449 struct intel_community *community) in intel_pinctrl_add_padgroups_by_size() argument
1452 unsigned int npins = community->npins; in intel_pinctrl_add_padgroups_by_size()
1454 size_t i, ngpps = DIV_ROUND_UP(npins, community->gpp_size); in intel_pinctrl_add_padgroups_by_size()
1456 if (community->gpp_size > INTEL_PINCTRL_MAX_GPP_SIZE) in intel_pinctrl_add_padgroups_by_size()
1464 unsigned int gpp_size = community->gpp_size; in intel_pinctrl_add_padgroups_by_size()
1467 gpps[i].base = community->pin_base + i * gpp_size; in intel_pinctrl_add_padgroups_by_size()
1474 padown_num += community->gpp_num_padown_regs; in intel_pinctrl_add_padgroups_by_size()
1477 community->ngpps = ngpps; in intel_pinctrl_add_padgroups_by_size()
1478 community->gpps = gpps; in intel_pinctrl_add_padgroups_by_size()
1502 struct intel_community *community = &pctrl->communities[i]; in intel_pinctrl_pm_init() local
1505 intmask = devm_kcalloc(pctrl->dev, community->ngpps, in intel_pinctrl_pm_init()
1512 hostown = devm_kcalloc(pctrl->dev, community->ngpps, in intel_pinctrl_pm_init()
1528 struct intel_community *community) in intel_pinctrl_probe_pwm() argument
1538 if (!(community->features & PINCTRL_FEATURE_PWM)) in intel_pinctrl_probe_pwm()
1544 chip = devm_pwm_lpss_probe(pctrl->dev, community->regs + PWMC, &info); in intel_pinctrl_probe_pwm()
1574 struct intel_community *community = &pctrl->communities[i]; in intel_pinctrl_probe() local
1579 *community = pctrl->soc->communities[i]; in intel_pinctrl_probe()
1581 regs = devm_platform_ioremap_resource(pdev, community->barno); in intel_pinctrl_probe()
1593 community->features |= PINCTRL_FEATURE_DEBOUNCE; in intel_pinctrl_probe()
1594 community->features |= PINCTRL_FEATURE_1K_PD; in intel_pinctrl_probe()
1603 community->features |= PINCTRL_FEATURE_GPIO_HW_INFO; in intel_pinctrl_probe()
1606 community->features |= PINCTRL_FEATURE_PWM; in intel_pinctrl_probe()
1609 community->features |= PINCTRL_FEATURE_BLINK; in intel_pinctrl_probe()
1612 community->features |= PINCTRL_FEATURE_EXP; in intel_pinctrl_probe()
1620 dev_dbg(dev, "Community%d features: %#08x\n", i, community->features); in intel_pinctrl_probe()
1625 community->regs = regs; in intel_pinctrl_probe()
1626 community->pad_regs = regs + offset; in intel_pinctrl_probe()
1628 if (community->gpps) in intel_pinctrl_probe()
1629 ret = intel_pinctrl_add_padgroups_by_gpps(pctrl, community); in intel_pinctrl_probe()
1631 ret = intel_pinctrl_add_padgroups_by_size(pctrl, community); in intel_pinctrl_probe()
1635 ret = intel_pinctrl_probe_pwm(pctrl, community); in intel_pinctrl_probe()
1798 struct intel_community *community = &pctrl->communities[i]; in intel_pinctrl_suspend_noirq() local
1802 base = community->regs + community->ie_offset; in intel_pinctrl_suspend_noirq()
1803 for (gpp = 0; gpp < community->ngpps; gpp++) in intel_pinctrl_suspend_noirq()
1806 base = community->regs + community->hostown_offset; in intel_pinctrl_suspend_noirq()
1807 for (gpp = 0; gpp < community->ngpps; gpp++) in intel_pinctrl_suspend_noirq()
1831 const struct intel_community *community = &pctrl->communities[c]; in intel_restore_hostown() local
1832 const struct intel_padgroup *padgrp = &community->gpps[gpp]; in intel_restore_hostown()
1908 struct intel_community *community = &pctrl->communities[i]; in intel_pinctrl_resume_noirq() local
1912 base = community->regs + community->ie_offset; in intel_pinctrl_resume_noirq()
1913 for (gpp = 0; gpp < community->ngpps; gpp++) in intel_pinctrl_resume_noirq()
1916 base = community->regs + community->hostown_offset; in intel_pinctrl_resume_noirq()
1917 for (gpp = 0; gpp < community->ngpps; gpp++) in intel_pinctrl_resume_noirq()