diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-19 14:19:33 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-19 14:19:33 -0700 |
commit | 3c2edc36a77420d8be05d656019dbc8c31535992 (patch) | |
tree | 70d8c9abb04c89e82c79c46efd2f7cb1bf836ef5 /drivers/pinctrl/intel/pinctrl-baytrail.c | |
parent | 32b90daf5cafdda62b1ce62d0b7445fa9107babf (diff) | |
parent | cb0438e4436085d89706b5ccfce4d5da531253de (diff) | |
download | linux-3c2edc36a77420d8be05d656019dbc8c31535992.tar.gz |
Merge tag 'pinctrl-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control updates from Linus Walleij:
"This is the bulk of pin control changes for the v5.4 kernel cycle:
Core changes:
- Fix errors in example code in the documentation.
New drivers:
- Add support for JZ4760, JZ4760B, X1000, X1000E and X1500 to the
Ingenic driver.
- Support Cirrus Logic Madera CS47L92 and CS47L15.
- Support Allwinner Sunxi V3S.
- Support Aspeed 2600 BMC.
- Support Qualcomm SC7180.
- Support Marvell MVEBU CS115.
Driver improvements:
- Clean up a few drivers to use the devm_platform_ioremap_resource()
helper.
- Pass the irqchip when registering the gpio_chip in some pin
controllers that are also GPIO controllers.
- Support suspend/resume in the Tegra driver.
- Support pull-up on the Broadcom BCM2711.
- The Intel driver can now request locked pads.
- Fix the UFS reset pin in the Qualcomm SDM845 driver"
* tag 'pinctrl-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (112 commits)
pinctrl: meson-gxbb: Fix wrong pinning definition for uart_c
pinctrl: sh-pfc: Unlock on error in sh_pfc_func_set_mux()
pinctrl: bcm: remove redundant assignment to pointer log
pinctrl: iproc: Add 'get_direction' support
pinctrl: iproc-gpio: Handle interrupts for multiple instances
pinctrl: iproc-gpio: Fix incorrect pinconf configurations
pinctrl: intel: mark intel_pin_to_gpio __maybe_unused
pinctrl: qcom: sdm845: Fix UFS_RESET pin
pinctrl: mvebu: add additional variant for standalone CP115
pinctrl: mvebu: Add CP110 missing pin functionality
dt-bindings: cp110: document the new CP115 pinctrl compatible
pinctrl: bcm2835: Pass irqchip when adding gpiochip
pinctrl: meson: meson: Add of_node_put() before return
pinctrl/gpio: Take MUX usage into account
dt-bindings: pinctrl: qcom-pmic-gpio: Add pm8150l support
dt-bindings: pinctrl: qcom-pmic-gpio: Add pm8150b support
dt-bindings: pinctrl: qcom-pmic-gpio: Add pm8150 support
pinctrl: amd: disable spurious-firing GPIO IRQs
pinctrl: rza2: Include the appropriate headers
pinctrl: rza2: Drop driver use of consumer flags
...
Diffstat (limited to 'drivers/pinctrl/intel/pinctrl-baytrail.c')
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-baytrail.c | 67 |
1 files changed, 23 insertions, 44 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index 297b7b5fcb28..9ffb22211d2b 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c @@ -98,13 +98,6 @@ struct byt_gpio_pin_context { u32 val; }; -struct byt_community { - unsigned int pin_base; - size_t npins; - const unsigned int *pad_map; - void __iomem *reg_base; -}; - #define COMMUNITY(p, n, map) \ { \ .pin_base = (p), \ @@ -112,26 +105,14 @@ struct byt_community { .pad_map = (map),\ } -struct byt_pinctrl_soc_data { - const char *uid; - const struct pinctrl_pin_desc *pins; - size_t npins; - const struct intel_pingroup *groups; - size_t ngroups; - const struct intel_function *functions; - size_t nfunctions; - const struct byt_community *communities; - size_t ncommunities; -}; - struct byt_gpio { struct gpio_chip chip; struct platform_device *pdev; struct pinctrl_dev *pctl_dev; struct pinctrl_desc pctl_desc; raw_spinlock_t lock; - const struct byt_pinctrl_soc_data *soc_data; - struct byt_community *communities_copy; + const struct intel_pinctrl_soc_data *soc_data; + struct intel_community *communities_copy; struct byt_gpio_pin_context *saved_context; }; @@ -383,11 +364,11 @@ static const struct intel_function byt_score_functions[] = { FUNCTION("gpio", byt_score_gpio_groups), }; -static const struct byt_community byt_score_communities[] = { +static const struct intel_community byt_score_communities[] = { COMMUNITY(0, BYT_NGPIO_SCORE, byt_score_pins_map), }; -static const struct byt_pinctrl_soc_data byt_score_soc_data = { +static const struct intel_pinctrl_soc_data byt_score_soc_data = { .uid = BYT_SCORE_ACPI_UID, .pins = byt_score_pins, .npins = ARRAY_SIZE(byt_score_pins), @@ -496,11 +477,11 @@ static const struct intel_function byt_sus_functions[] = { FUNCTION("gpio", byt_sus_gpio_groups), }; -static const struct byt_community byt_sus_communities[] = { +static const struct intel_community byt_sus_communities[] = { COMMUNITY(0, BYT_NGPIO_SUS, byt_sus_pins_map), }; -static const struct byt_pinctrl_soc_data byt_sus_soc_data = { +static const struct intel_pinctrl_soc_data byt_sus_soc_data = { .uid = BYT_SUS_ACPI_UID, .pins = byt_sus_pins, .npins = ARRAY_SIZE(byt_sus_pins), @@ -549,11 +530,11 @@ static const unsigned int byt_ncore_pins_map[BYT_NGPIO_NCORE] = { 3, 6, 10, 13, 2, 5, 9, 7, }; -static const struct byt_community byt_ncore_communities[] = { +static const struct intel_community byt_ncore_communities[] = { COMMUNITY(0, BYT_NGPIO_NCORE, byt_ncore_pins_map), }; -static const struct byt_pinctrl_soc_data byt_ncore_soc_data = { +static const struct intel_pinctrl_soc_data byt_ncore_soc_data = { .uid = BYT_NCORE_ACPI_UID, .pins = byt_ncore_pins, .npins = ARRAY_SIZE(byt_ncore_pins), @@ -561,17 +542,17 @@ static const struct byt_pinctrl_soc_data byt_ncore_soc_data = { .ncommunities = ARRAY_SIZE(byt_ncore_communities), }; -static const struct byt_pinctrl_soc_data *byt_soc_data[] = { +static const struct intel_pinctrl_soc_data *byt_soc_data[] = { &byt_score_soc_data, &byt_sus_soc_data, &byt_ncore_soc_data, NULL }; -static struct byt_community *byt_get_community(struct byt_gpio *vg, - unsigned int pin) +static struct intel_community *byt_get_community(struct byt_gpio *vg, + unsigned int pin) { - struct byt_community *comm; + struct intel_community *comm; int i; for (i = 0; i < vg->soc_data->ncommunities; i++) { @@ -586,7 +567,7 @@ static struct byt_community *byt_get_community(struct byt_gpio *vg, static void __iomem *byt_gpio_reg(struct byt_gpio *vg, unsigned int offset, int reg) { - struct byt_community *comm = byt_get_community(vg, offset); + struct intel_community *comm = byt_get_community(vg, offset); u32 reg_offset; if (!comm) @@ -605,7 +586,7 @@ static void __iomem *byt_gpio_reg(struct byt_gpio *vg, unsigned int offset, break; } - return comm->reg_base + reg_offset + reg; + return comm->pad_regs + reg_offset + reg; } static int byt_get_groups_count(struct pinctrl_dev *pctldev) @@ -1211,7 +1192,7 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) u32 conf0, val; for (i = 0; i < vg->soc_data->npins; i++) { - const struct byt_community *comm; + const struct intel_community *comm; const char *pull_str = NULL; const char *pull = NULL; void __iomem *reg; @@ -1580,7 +1561,7 @@ static int byt_gpio_probe(struct byt_gpio *vg) } static int byt_set_soc_data(struct byt_gpio *vg, - const struct byt_pinctrl_soc_data *soc_data) + const struct intel_pinctrl_soc_data *soc_data) { int i; @@ -1593,15 +1574,13 @@ static int byt_set_soc_data(struct byt_gpio *vg, return -ENOMEM; for (i = 0; i < soc_data->ncommunities; i++) { - struct byt_community *comm = vg->communities_copy + i; - struct resource *mem_rc; + struct intel_community *comm = vg->communities_copy + i; *comm = vg->soc_data->communities[i]; - mem_rc = platform_get_resource(vg->pdev, IORESOURCE_MEM, 0); - comm->reg_base = devm_ioremap_resource(&vg->pdev->dev, mem_rc); - if (IS_ERR(comm->reg_base)) - return PTR_ERR(comm->reg_base); + comm->pad_regs = devm_platform_ioremap_resource(vg->pdev, 0); + if (IS_ERR(comm->pad_regs)) + return PTR_ERR(comm->pad_regs); } return 0; @@ -1615,8 +1594,8 @@ static const struct acpi_device_id byt_gpio_acpi_match[] = { static int byt_pinctrl_probe(struct platform_device *pdev) { - const struct byt_pinctrl_soc_data *soc_data = NULL; - const struct byt_pinctrl_soc_data **soc_table; + const struct intel_pinctrl_soc_data *soc_data = NULL; + const struct intel_pinctrl_soc_data **soc_table; struct acpi_device *acpi_dev; struct byt_gpio *vg; int i, ret; @@ -1625,7 +1604,7 @@ static int byt_pinctrl_probe(struct platform_device *pdev) if (!acpi_dev) return -ENODEV; - soc_table = (const struct byt_pinctrl_soc_data **)device_get_match_data(&pdev->dev); + soc_table = (const struct intel_pinctrl_soc_data **)device_get_match_data(&pdev->dev); for (i = 0; soc_table[i]; i++) { if (!strcmp(acpi_dev->pnp.unique_id, soc_table[i]->uid)) { |