Lines Matching full:lg
213 struct intel_pinctrl *lg = gpiochip_get_data(chip); in lp_gpio_reg() local
217 comm = intel_get_community(lg, offset); in lp_gpio_reg()
233 static bool lp_gpio_acpi_use(struct intel_pinctrl *lg, unsigned int pin) in lp_gpio_acpi_use() argument
237 acpi_use = lp_gpio_reg(&lg->chip, pin, LP_ACPI_OWNED); in lp_gpio_acpi_use()
264 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_pin_dbg_show() local
265 void __iomem *reg = lp_gpio_reg(&lg->chip, pin, LP_CONFIG1); in lp_pin_dbg_show()
266 void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); in lp_pin_dbg_show()
279 if (lp_gpio_acpi_use(lg, pin)) in lp_pin_dbg_show()
293 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_pinmux_set_mux() local
294 const struct intel_pingroup *grp = &lg->soc->groups[group]; in lp_pinmux_set_mux()
297 guard(raw_spinlock_irqsave)(&lg->lock); in lp_pinmux_set_mux()
301 void __iomem *reg = lp_gpio_reg(&lg->chip, grp->grp.pins[i], LP_CONFIG1); in lp_pinmux_set_mux()
332 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_gpio_request_enable() local
333 void __iomem *reg = lp_gpio_reg(&lg->chip, pin, LP_CONFIG1); in lp_gpio_request_enable()
334 void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); in lp_gpio_request_enable()
337 guard(raw_spinlock_irqsave)(&lg->lock); in lp_gpio_request_enable()
346 dev_warn(lg->dev, FW_BUG "pin %u forcibly reconfigured as GPIO\n", pin); in lp_gpio_request_enable()
359 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_gpio_disable_free() local
360 void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); in lp_gpio_disable_free()
362 guard(raw_spinlock_irqsave)(&lg->lock); in lp_gpio_disable_free()
372 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_gpio_set_direction() local
373 void __iomem *reg = lp_gpio_reg(&lg->chip, pin, LP_CONFIG1); in lp_gpio_set_direction()
376 guard(raw_spinlock_irqsave)(&lg->lock); in lp_gpio_set_direction()
389 WARN(lp_gpio_ioxapic_use(&lg->chip, pin), in lp_gpio_set_direction()
410 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_pin_config_get() local
411 void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); in lp_pin_config_get()
416 scoped_guard(raw_spinlock_irqsave, &lg->lock) in lp_pin_config_get()
451 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_pin_config_set() local
452 void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); in lp_pin_config_set()
457 guard(raw_spinlock_irqsave)(&lg->lock); in lp_pin_config_set()
508 struct intel_pinctrl *lg = gpiochip_get_data(chip); in lp_gpio_set() local
511 guard(raw_spinlock_irqsave)(&lg->lock); in lp_gpio_set()
546 struct intel_pinctrl *lg = gpiochip_get_data(gc); in lp_gpio_irq_handler() local
553 for (base = 0; base < lg->chip.ngpio; base += 32) { in lp_gpio_irq_handler()
554 reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT); in lp_gpio_irq_handler()
555 ena = lp_gpio_reg(&lg->chip, base, LP_INT_ENABLE); in lp_gpio_irq_handler()
561 generic_handle_domain_irq(lg->chip.irq.domain, base + pin); in lp_gpio_irq_handler()
569 struct intel_pinctrl *lg = gpiochip_get_data(gc); in lp_irq_ack() local
571 void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_STAT); in lp_irq_ack()
573 guard(raw_spinlock_irqsave)(&lg->lock); in lp_irq_ack()
589 struct intel_pinctrl *lg = gpiochip_get_data(gc); in lp_irq_enable() local
591 void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_ENABLE); in lp_irq_enable()
595 scoped_guard(raw_spinlock_irqsave, &lg->lock) in lp_irq_enable()
602 struct intel_pinctrl *lg = gpiochip_get_data(gc); in lp_irq_disable() local
604 void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_ENABLE); in lp_irq_disable()
606 scoped_guard(raw_spinlock_irqsave, &lg->lock) in lp_irq_disable()
615 struct intel_pinctrl *lg = gpiochip_get_data(gc); in lp_irq_set_type() local
620 reg = lp_gpio_reg(&lg->chip, hwirq, LP_CONFIG1); in lp_irq_set_type()
625 if (lp_gpio_acpi_use(lg, hwirq)) { in lp_irq_set_type()
626 dev_err(lg->dev, "pin %lu can't be used as IRQ\n", hwirq); in lp_irq_set_type()
630 guard(raw_spinlock_irqsave)(&lg->lock); in lp_irq_set_type()
674 struct intel_pinctrl *lg = gpiochip_get_data(chip); in lp_gpio_irq_init_hw() local
678 for (base = 0; base < lg->chip.ngpio; base += 32) { in lp_gpio_irq_init_hw()
680 reg = lp_gpio_reg(&lg->chip, base, LP_INT_ENABLE); in lp_gpio_irq_init_hw()
683 reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT); in lp_gpio_irq_init_hw()
692 struct intel_pinctrl *lg = gpiochip_get_data(chip); in lp_gpio_add_pin_ranges() local
693 struct device *dev = lg->dev; in lp_gpio_add_pin_ranges()
696 ret = gpiochip_add_pin_range(chip, dev_name(dev), 0, 0, lg->soc->npins); in lp_gpio_add_pin_ranges()
706 struct intel_pinctrl *lg; in lp_gpio_probe() local
718 lg = devm_kzalloc(dev, sizeof(*lg), GFP_KERNEL); in lp_gpio_probe()
719 if (!lg) in lp_gpio_probe()
722 lg->dev = dev; in lp_gpio_probe()
723 lg->soc = soc; in lp_gpio_probe()
725 lg->ncommunities = lg->soc->ncommunities; in lp_gpio_probe()
726 lg->communities = devm_kcalloc(dev, lg->ncommunities, in lp_gpio_probe()
727 sizeof(*lg->communities), GFP_KERNEL); in lp_gpio_probe()
728 if (!lg->communities) in lp_gpio_probe()
731 lg->pctldesc = lptlp_pinctrl_desc; in lp_gpio_probe()
732 lg->pctldesc.name = dev_name(dev); in lp_gpio_probe()
733 lg->pctldesc.pins = lg->soc->pins; in lp_gpio_probe()
734 lg->pctldesc.npins = lg->soc->npins; in lp_gpio_probe()
736 lg->pctldev = devm_pinctrl_register(dev, &lg->pctldesc, lg); in lp_gpio_probe()
737 if (IS_ERR(lg->pctldev)) { in lp_gpio_probe()
739 return PTR_ERR(lg->pctldev); in lp_gpio_probe()
742 platform_set_drvdata(pdev, lg); in lp_gpio_probe()
756 for (i = 0; i < lg->soc->ncommunities; i++) { in lp_gpio_probe()
757 struct intel_community *comm = &lg->communities[i]; in lp_gpio_probe()
759 *comm = lg->soc->communities[i]; in lp_gpio_probe()
765 raw_spin_lock_init(&lg->lock); in lp_gpio_probe()
767 gc = &lg->chip; in lp_gpio_probe()
804 ret = devm_gpiochip_add_data(dev, gc, lg); in lp_gpio_probe()
815 struct intel_pinctrl *lg = dev_get_drvdata(dev); in lp_gpio_resume() local
816 struct gpio_chip *chip = &lg->chip; in lp_gpio_resume()