Lines Matching refs:community

112 	struct intel_community *community;  in intel_get_community()  local
116 community = &pctrl->communities[i]; in intel_get_community()
117 if (pin >= community->pin_base && in intel_get_community()
118 pin < community->pin_base + community->npins) in intel_get_community()
119 return community; in intel_get_community()
128 intel_community_get_padgroup(const struct intel_community *community, in intel_community_get_padgroup() argument
133 for (i = 0; i < community->ngpps; i++) { in intel_community_get_padgroup()
134 const struct intel_padgroup *padgrp = &community->gpps[i]; in intel_community_get_padgroup()
146 const struct intel_community *community; in intel_get_padcfg() local
150 community = intel_get_community(pctrl, pin); in intel_get_padcfg()
151 if (!community) in intel_get_padcfg()
154 padno = pin_to_padno(community, pin); in intel_get_padcfg()
155 nregs = (community->features & PINCTRL_FEATURE_DEBOUNCE) ? 4 : 2; in intel_get_padcfg()
160 return community->pad_regs + reg + padno * nregs * 4; in intel_get_padcfg()
165 const struct intel_community *community; in intel_pad_owned_by_host() local
170 community = intel_get_community(pctrl, pin); in intel_pad_owned_by_host()
171 if (!community) in intel_pad_owned_by_host()
173 if (!community->padown_offset) in intel_pad_owned_by_host()
176 padgrp = intel_community_get_padgroup(community, pin); in intel_pad_owned_by_host()
182 offset = community->padown_offset + padgrp->padown_num * 4 + gpp * 4; in intel_pad_owned_by_host()
183 padown = community->regs + offset; in intel_pad_owned_by_host()
190 const struct intel_community *community; in intel_pad_acpi_mode() local
195 community = intel_get_community(pctrl, pin); in intel_pad_acpi_mode()
196 if (!community) in intel_pad_acpi_mode()
198 if (!community->hostown_offset) in intel_pad_acpi_mode()
201 padgrp = intel_community_get_padgroup(community, pin); in intel_pad_acpi_mode()
206 offset = community->hostown_offset + padgrp->reg_num * 4; in intel_pad_acpi_mode()
207 hostown = community->regs + offset; in intel_pad_acpi_mode()
233 struct intel_community *community; in intel_pad_locked() local
239 community = intel_get_community(pctrl, pin); in intel_pad_locked()
240 if (!community) in intel_pad_locked()
242 if (!community->padcfglock_offset) in intel_pad_locked()
245 padgrp = intel_community_get_padgroup(community, pin); in intel_pad_locked()
256 offset = community->padcfglock_offset + 0 + padgrp->reg_num * 8; in intel_pad_locked()
257 value = readl(community->regs + offset); in intel_pad_locked()
261 offset = community->padcfglock_offset + 4 + padgrp->reg_num * 8; in intel_pad_locked()
262 value = readl(community->regs + offset); in intel_pad_locked()
551 const struct intel_community *community; in intel_config_get_pull() local
556 community = intel_get_community(pctrl, pin); in intel_config_get_pull()
601 if (!(community->features & PINCTRL_FEATURE_1K_PD)) in intel_config_get_pull()
606 if (!(community->features & PINCTRL_FEATURE_1K_PD)) in intel_config_get_pull()
693 const struct intel_community *community; in intel_config_set_pull() local
699 community = intel_get_community(pctrl, pin); in intel_config_set_pull()
752 if (!(community->features & PINCTRL_FEATURE_1K_PD)) { in intel_config_set_pull()
759 if (!(community->features & PINCTRL_FEATURE_1K_PD)) { in intel_config_set_pull()
892 const struct intel_community **community, in intel_gpio_to_pin() argument
912 if (community) in intel_gpio_to_pin()
913 *community = comm; in intel_gpio_to_pin()
936 const struct intel_community *community; in intel_pin_to_gpio() local
939 community = intel_get_community(pctrl, pin); in intel_pin_to_gpio()
940 if (!community) in intel_pin_to_gpio()
943 padgrp = intel_community_get_padgroup(community, pin); in intel_pin_to_gpio()
1055 const struct intel_community *community; in intel_gpio_irq_ack() local
1059 pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), &community, &padgrp); in intel_gpio_irq_ack()
1065 is_offset = community->is_offset + gpp * 4; in intel_gpio_irq_ack()
1068 writel(BIT(gpp_offset), community->regs + is_offset); in intel_gpio_irq_ack()
1076 const struct intel_community *community; in intel_gpio_irq_mask_unmask() local
1080 pin = intel_gpio_to_pin(pctrl, hwirq, &community, &padgrp); in intel_gpio_irq_mask_unmask()
1090 reg = community->regs + community->ie_offset + gpp * 4; in intel_gpio_irq_mask_unmask()
1091 is = community->regs + community->is_offset + gpp * 4; in intel_gpio_irq_mask_unmask()
1214 const struct intel_community *community) in intel_gpio_community_irq_handler() argument
1220 for (gpp = 0; gpp < community->ngpps; gpp++) { in intel_gpio_community_irq_handler()
1221 const struct intel_padgroup *padgrp = &community->gpps[gpp]; in intel_gpio_community_irq_handler()
1226 pending = readl(community->regs + community->is_offset + in intel_gpio_community_irq_handler()
1228 enabled = readl(community->regs + community->ie_offset + in intel_gpio_community_irq_handler()
1247 const struct intel_community *community; in intel_gpio_irq() local
1254 community = &pctrl->communities[i]; in intel_gpio_irq()
1255 ret += intel_gpio_community_irq_handler(pctrl, community); in intel_gpio_irq()
1266 const struct intel_community *community; in intel_gpio_irq_init() local
1270 community = &pctrl->communities[i]; in intel_gpio_irq_init()
1271 base = community->regs; in intel_gpio_irq_init()
1273 for (gpp = 0; gpp < community->ngpps; gpp++) { in intel_gpio_irq_init()
1275 writel(0, base + community->ie_offset + gpp * 4); in intel_gpio_irq_init()
1276 writel(0xffff, base + community->is_offset + gpp * 4); in intel_gpio_irq_init()
1295 const struct intel_community *community) in intel_gpio_add_community_ranges() argument
1299 for (i = 0; i < community->ngpps; i++) { in intel_gpio_add_community_ranges()
1300 const struct intel_padgroup *gpp = &community->gpps[i]; in intel_gpio_add_community_ranges()
1321 struct intel_community *community = &pctrl->communities[i]; in intel_gpio_add_pin_ranges() local
1323 ret = intel_gpio_add_community_ranges(pctrl, community); in intel_gpio_add_pin_ranges()
1335 const struct intel_community *community; in intel_gpio_ngpio() local
1340 community = &pctrl->communities[i]; in intel_gpio_ngpio()
1341 for (j = 0; j < community->ngpps; j++) { in intel_gpio_ngpio()
1342 const struct intel_padgroup *gpp = &community->gpps[j]; in intel_gpio_ngpio()
1402 struct intel_community *community) in intel_pinctrl_add_padgroups_by_gpps() argument
1406 size_t i, ngpps = community->ngpps; in intel_pinctrl_add_padgroups_by_gpps()
1413 gpps[i] = community->gpps[i]; in intel_pinctrl_add_padgroups_by_gpps()
1436 community->gpps = gpps; in intel_pinctrl_add_padgroups_by_gpps()
1442 struct intel_community *community) in intel_pinctrl_add_padgroups_by_size() argument
1445 unsigned int npins = community->npins; in intel_pinctrl_add_padgroups_by_size()
1447 size_t i, ngpps = DIV_ROUND_UP(npins, community->gpp_size); in intel_pinctrl_add_padgroups_by_size()
1449 if (community->gpp_size > INTEL_PINCTRL_MAX_GPP_SIZE) in intel_pinctrl_add_padgroups_by_size()
1457 unsigned int gpp_size = community->gpp_size; in intel_pinctrl_add_padgroups_by_size()
1460 gpps[i].base = community->pin_base + i * gpp_size; in intel_pinctrl_add_padgroups_by_size()
1467 padown_num += community->gpp_num_padown_regs; in intel_pinctrl_add_padgroups_by_size()
1470 community->ngpps = ngpps; in intel_pinctrl_add_padgroups_by_size()
1471 community->gpps = gpps; in intel_pinctrl_add_padgroups_by_size()
1495 struct intel_community *community = &pctrl->communities[i]; in intel_pinctrl_pm_init() local
1498 intmask = devm_kcalloc(pctrl->dev, community->ngpps, in intel_pinctrl_pm_init()
1505 hostown = devm_kcalloc(pctrl->dev, community->ngpps, in intel_pinctrl_pm_init()
1521 struct intel_community *community) in intel_pinctrl_probe_pwm() argument
1531 if (!(community->features & PINCTRL_FEATURE_PWM)) in intel_pinctrl_probe_pwm()
1537 pwm = devm_pwm_lpss_probe(pctrl->dev, community->regs + PWMC, &info); in intel_pinctrl_probe_pwm()
1567 struct intel_community *community = &pctrl->communities[i]; in intel_pinctrl_probe() local
1572 *community = pctrl->soc->communities[i]; in intel_pinctrl_probe()
1574 regs = devm_platform_ioremap_resource(pdev, community->barno); in intel_pinctrl_probe()
1586 community->features |= PINCTRL_FEATURE_DEBOUNCE; in intel_pinctrl_probe()
1587 community->features |= PINCTRL_FEATURE_1K_PD; in intel_pinctrl_probe()
1596 community->features |= PINCTRL_FEATURE_GPIO_HW_INFO; in intel_pinctrl_probe()
1599 community->features |= PINCTRL_FEATURE_PWM; in intel_pinctrl_probe()
1602 community->features |= PINCTRL_FEATURE_BLINK; in intel_pinctrl_probe()
1605 community->features |= PINCTRL_FEATURE_EXP; in intel_pinctrl_probe()
1613 dev_dbg(dev, "Community%d features: %#08x\n", i, community->features); in intel_pinctrl_probe()
1618 community->regs = regs; in intel_pinctrl_probe()
1619 community->pad_regs = regs + offset; in intel_pinctrl_probe()
1621 if (community->gpps) in intel_pinctrl_probe()
1622 ret = intel_pinctrl_add_padgroups_by_gpps(pctrl, community); in intel_pinctrl_probe()
1624 ret = intel_pinctrl_add_padgroups_by_size(pctrl, community); in intel_pinctrl_probe()
1628 ret = intel_pinctrl_probe_pwm(pctrl, community); in intel_pinctrl_probe()
1791 struct intel_community *community = &pctrl->communities[i]; in intel_pinctrl_suspend_noirq() local
1795 base = community->regs + community->ie_offset; in intel_pinctrl_suspend_noirq()
1796 for (gpp = 0; gpp < community->ngpps; gpp++) in intel_pinctrl_suspend_noirq()
1799 base = community->regs + community->hostown_offset; in intel_pinctrl_suspend_noirq()
1800 for (gpp = 0; gpp < community->ngpps; gpp++) in intel_pinctrl_suspend_noirq()
1825 const struct intel_community *community = &pctrl->communities[c]; in intel_restore_hostown() local
1826 const struct intel_padgroup *padgrp = &community->gpps[gpp]; in intel_restore_hostown()
1902 struct intel_community *community = &pctrl->communities[i]; in intel_pinctrl_resume_noirq() local
1906 base = community->regs + community->ie_offset; in intel_pinctrl_resume_noirq()
1907 for (gpp = 0; gpp < community->ngpps; gpp++) in intel_pinctrl_resume_noirq()
1910 base = community->regs + community->hostown_offset; in intel_pinctrl_resume_noirq()
1911 for (gpp = 0; gpp < community->ngpps; gpp++) in intel_pinctrl_resume_noirq()