Lines Matching full:lg

212 	struct intel_pinctrl *lg = gpiochip_get_data(chip);  in lp_gpio_reg()  local
216 comm = intel_get_community(lg, offset); in lp_gpio_reg()
232 static bool lp_gpio_acpi_use(struct intel_pinctrl *lg, unsigned int pin) in lp_gpio_acpi_use() argument
236 acpi_use = lp_gpio_reg(&lg->chip, pin, LP_ACPI_OWNED); in lp_gpio_acpi_use()
263 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_pin_dbg_show() local
264 void __iomem *reg = lp_gpio_reg(&lg->chip, pin, LP_CONFIG1); in lp_pin_dbg_show()
265 void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); in lp_pin_dbg_show()
278 if (lp_gpio_acpi_use(lg, pin)) in lp_pin_dbg_show()
292 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_pinmux_set_mux() local
293 const struct intel_pingroup *grp = &lg->soc->groups[group]; in lp_pinmux_set_mux()
297 raw_spin_lock_irqsave(&lg->lock, flags); 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()
315 raw_spin_unlock_irqrestore(&lg->lock, flags); in lp_pinmux_set_mux()
334 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_gpio_request_enable() local
335 void __iomem *reg = lp_gpio_reg(&lg->chip, pin, LP_CONFIG1); in lp_gpio_request_enable()
336 void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); in lp_gpio_request_enable()
340 pm_runtime_get(lg->dev); in lp_gpio_request_enable()
342 raw_spin_lock_irqsave(&lg->lock, flags); in lp_gpio_request_enable()
351 dev_warn(lg->dev, FW_BUG "pin %u forcibly reconfigured as GPIO\n", pin); in lp_gpio_request_enable()
357 raw_spin_unlock_irqrestore(&lg->lock, flags); in lp_gpio_request_enable()
366 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_gpio_disable_free() local
367 void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); in lp_gpio_disable_free()
370 raw_spin_lock_irqsave(&lg->lock, flags); in lp_gpio_disable_free()
375 raw_spin_unlock_irqrestore(&lg->lock, flags); in lp_gpio_disable_free()
377 pm_runtime_put(lg->dev); in lp_gpio_disable_free()
384 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_gpio_set_direction() local
385 void __iomem *reg = lp_gpio_reg(&lg->chip, pin, LP_CONFIG1); in lp_gpio_set_direction()
389 raw_spin_lock_irqsave(&lg->lock, flags); in lp_gpio_set_direction()
402 WARN(lp_gpio_ioxapic_use(&lg->chip, pin), in lp_gpio_set_direction()
407 raw_spin_unlock_irqrestore(&lg->lock, flags); in lp_gpio_set_direction()
425 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_pin_config_get() local
426 void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); in lp_pin_config_get()
432 raw_spin_lock_irqsave(&lg->lock, flags); in lp_pin_config_get()
434 raw_spin_unlock_irqrestore(&lg->lock, flags); in lp_pin_config_get()
468 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); in lp_pin_config_set() local
469 void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); in lp_pin_config_set()
475 raw_spin_lock_irqsave(&lg->lock, flags); in lp_pin_config_set()
506 raw_spin_unlock_irqrestore(&lg->lock, flags); in lp_pin_config_set()
532 struct intel_pinctrl *lg = gpiochip_get_data(chip); in lp_gpio_set() local
536 raw_spin_lock_irqsave(&lg->lock, flags); in lp_gpio_set()
543 raw_spin_unlock_irqrestore(&lg->lock, flags); in lp_gpio_set()
573 struct intel_pinctrl *lg = gpiochip_get_data(gc); in lp_gpio_irq_handler() local
580 for (base = 0; base < lg->chip.ngpio; base += 32) { in lp_gpio_irq_handler()
581 reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT); in lp_gpio_irq_handler()
582 ena = lp_gpio_reg(&lg->chip, base, LP_INT_ENABLE); in lp_gpio_irq_handler()
588 generic_handle_domain_irq(lg->chip.irq.domain, base + pin); in lp_gpio_irq_handler()
596 struct intel_pinctrl *lg = gpiochip_get_data(gc); in lp_irq_ack() local
598 void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_STAT); in lp_irq_ack()
601 raw_spin_lock_irqsave(&lg->lock, flags); in lp_irq_ack()
603 raw_spin_unlock_irqrestore(&lg->lock, flags); in lp_irq_ack()
617 struct intel_pinctrl *lg = gpiochip_get_data(gc); in lp_irq_enable() local
619 void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_ENABLE); in lp_irq_enable()
624 raw_spin_lock_irqsave(&lg->lock, flags); in lp_irq_enable()
626 raw_spin_unlock_irqrestore(&lg->lock, flags); in lp_irq_enable()
632 struct intel_pinctrl *lg = gpiochip_get_data(gc); in lp_irq_disable() local
634 void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_ENABLE); in lp_irq_disable()
637 raw_spin_lock_irqsave(&lg->lock, flags); in lp_irq_disable()
639 raw_spin_unlock_irqrestore(&lg->lock, flags); in lp_irq_disable()
647 struct intel_pinctrl *lg = gpiochip_get_data(gc); in lp_irq_set_type() local
653 reg = lp_gpio_reg(&lg->chip, hwirq, LP_CONFIG1); in lp_irq_set_type()
658 if (lp_gpio_acpi_use(lg, hwirq)) { in lp_irq_set_type()
659 dev_err(lg->dev, "pin %lu can't be used as IRQ\n", hwirq); in lp_irq_set_type()
663 raw_spin_lock_irqsave(&lg->lock, flags); in lp_irq_set_type()
689 raw_spin_unlock_irqrestore(&lg->lock, flags); in lp_irq_set_type()
708 struct intel_pinctrl *lg = gpiochip_get_data(chip); in lp_gpio_irq_init_hw() local
712 for (base = 0; base < lg->chip.ngpio; base += 32) { in lp_gpio_irq_init_hw()
714 reg = lp_gpio_reg(&lg->chip, base, LP_INT_ENABLE); in lp_gpio_irq_init_hw()
717 reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT); in lp_gpio_irq_init_hw()
726 struct intel_pinctrl *lg = gpiochip_get_data(chip); in lp_gpio_add_pin_ranges() local
727 struct device *dev = lg->dev; in lp_gpio_add_pin_ranges()
730 ret = gpiochip_add_pin_range(chip, dev_name(dev), 0, 0, lg->soc->npins); in lp_gpio_add_pin_ranges()
740 struct intel_pinctrl *lg; in lp_gpio_probe() local
752 lg = devm_kzalloc(dev, sizeof(*lg), GFP_KERNEL); in lp_gpio_probe()
753 if (!lg) in lp_gpio_probe()
756 lg->dev = dev; in lp_gpio_probe()
757 lg->soc = soc; in lp_gpio_probe()
759 lg->ncommunities = lg->soc->ncommunities; in lp_gpio_probe()
760 lg->communities = devm_kcalloc(dev, lg->ncommunities, in lp_gpio_probe()
761 sizeof(*lg->communities), GFP_KERNEL); in lp_gpio_probe()
762 if (!lg->communities) in lp_gpio_probe()
765 lg->pctldesc = lptlp_pinctrl_desc; in lp_gpio_probe()
766 lg->pctldesc.name = dev_name(dev); in lp_gpio_probe()
767 lg->pctldesc.pins = lg->soc->pins; in lp_gpio_probe()
768 lg->pctldesc.npins = lg->soc->npins; in lp_gpio_probe()
770 lg->pctldev = devm_pinctrl_register(dev, &lg->pctldesc, lg); in lp_gpio_probe()
771 if (IS_ERR(lg->pctldev)) { in lp_gpio_probe()
773 return PTR_ERR(lg->pctldev); in lp_gpio_probe()
776 platform_set_drvdata(pdev, lg); in lp_gpio_probe()
790 for (i = 0; i < lg->soc->ncommunities; i++) { in lp_gpio_probe()
791 struct intel_community *comm = &lg->communities[i]; in lp_gpio_probe()
793 *comm = lg->soc->communities[i]; in lp_gpio_probe()
799 raw_spin_lock_init(&lg->lock); in lp_gpio_probe()
801 gc = &lg->chip; in lp_gpio_probe()
838 ret = devm_gpiochip_add_data(dev, gc, lg); in lp_gpio_probe()
867 struct intel_pinctrl *lg = dev_get_drvdata(dev); in lp_gpio_resume() local
868 struct gpio_chip *chip = &lg->chip; in lp_gpio_resume()