Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: intel_soc_pmic_core: Add lookup table for Panel Control as GPIO signal

On some Intel SoC platforms, the panel enable/disable signals are
controlled by CRC PMIC. Add those control as a new GPIO in a lookup
table for gpio-crystalcove chip during CRC driver load

CC: Samuel Ortiz <sameo@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

authored by

Shobhit Kumar and committed by
Daniel Vetter
61dd2ca2 be9015ab

+17
+17
drivers/mfd/intel_soc_pmic_core.c
··· 24 24 #include <linux/acpi.h> 25 25 #include <linux/regmap.h> 26 26 #include <linux/mfd/intel_soc_pmic.h> 27 + #include <linux/gpio/machine.h> 27 28 #include "intel_soc_pmic_core.h" 29 + 30 + /* Lookup table for the Panel Enable/Disable line as GPIO signals */ 31 + static struct gpiod_lookup_table panel_gpio_table = { 32 + /* Intel GFX is consumer */ 33 + .dev_id = "0000:00:02.0", 34 + .table = { 35 + /* Panel EN/DISABLE */ 36 + GPIO_LOOKUP("gpio_crystalcove", 94, "panel", GPIO_ACTIVE_HIGH), 37 + }, 38 + }; 28 39 29 40 static int intel_soc_pmic_find_gpio_irq(struct device *dev) 30 41 { ··· 96 85 if (ret) 97 86 dev_warn(dev, "Can't enable IRQ as wake source: %d\n", ret); 98 87 88 + /* Add lookup table binding for Panel Control to the GPIO Chip */ 89 + gpiod_add_lookup_table(&panel_gpio_table); 90 + 99 91 ret = mfd_add_devices(dev, -1, config->cell_dev, 100 92 config->n_cell_devs, NULL, 0, 101 93 regmap_irq_get_domain(pmic->irq_chip_data)); ··· 117 103 struct intel_soc_pmic *pmic = dev_get_drvdata(&i2c->dev); 118 104 119 105 regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data); 106 + 107 + /* Remove lookup table for Panel Control from the GPIO Chip */ 108 + gpiod_remove_lookup_table(&panel_gpio_table); 120 109 121 110 mfd_remove_devices(&i2c->dev); 122 111