Commit 5495d163 authored by Linus Walleij's avatar Linus Walleij

Merge tag 'intel-pinctrl-v5.20-1' of...

Merge tag 'intel-pinctrl-v5.20-1' of gitolite.kernel.org:pub/scm/linux/kernel/git/pinctrl/intel into devel

intel-pinctrl for v5.20-1

* Update MAINTAINERS to set the Intel pin control status to Supported
* Switch Intel pin control drivers to use struct pingroup

The following is an automated git shortlog grouped by driver:

baytrail:
 -  Switch to to embedded struct pingroup

cherryview:
 -  Switch to to embedded struct pingroup

intel:
 -  Add Intel Meteor Lake pin controller support
 -  Drop no more used members of struct intel_pingroup
 -  Switch to to embedded struct pingroup
 -  Embed struct pingroup into struct intel_pingroup

lynxpoint:
 -  Switch to to embedded struct pingroup

MAINTAINERS:
 -  Update Intel pin control to Supported

Merge branch 'ib-v5.20-amd-pinctrl':
 - Merge branch 'ib-v5.20-amd-pinctrl'

merrifield:
 -  Switch to to embedded struct pingroup
parents 7542766e 25097de7
...@@ -15731,7 +15731,7 @@ F: drivers/pinctrl/freescale/ ...@@ -15731,7 +15731,7 @@ F: drivers/pinctrl/freescale/
PIN CONTROLLER - INTEL PIN CONTROLLER - INTEL
M: Mika Westerberg <mika.westerberg@linux.intel.com> M: Mika Westerberg <mika.westerberg@linux.intel.com>
M: Andy Shevchenko <andy@kernel.org> M: Andy Shevchenko <andy@kernel.org>
S: Maintained S: Supported
T: git git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git
F: drivers/pinctrl/intel/ F: drivers/pinctrl/intel/
......
...@@ -151,6 +151,14 @@ config PINCTRL_LEWISBURG ...@@ -151,6 +151,14 @@ config PINCTRL_LEWISBURG
This pinctrl driver provides an interface that allows configuring This pinctrl driver provides an interface that allows configuring
of Intel Lewisburg pins and using them as GPIOs. of Intel Lewisburg pins and using them as GPIOs.
config PINCTRL_METEORLAKE
tristate "Intel Meteor Lake pinctrl and GPIO driver"
depends on ACPI
select PINCTRL_INTEL
help
This pinctrl driver provides an interface that allows configuring
of Intel Meteor Lake pins and using them as GPIOs.
config PINCTRL_SUNRISEPOINT config PINCTRL_SUNRISEPOINT
tristate "Intel Sunrisepoint pinctrl and GPIO driver" tristate "Intel Sunrisepoint pinctrl and GPIO driver"
depends on ACPI depends on ACPI
......
...@@ -18,5 +18,6 @@ obj-$(CONFIG_PINCTRL_ICELAKE) += pinctrl-icelake.o ...@@ -18,5 +18,6 @@ obj-$(CONFIG_PINCTRL_ICELAKE) += pinctrl-icelake.o
obj-$(CONFIG_PINCTRL_JASPERLAKE) += pinctrl-jasperlake.o obj-$(CONFIG_PINCTRL_JASPERLAKE) += pinctrl-jasperlake.o
obj-$(CONFIG_PINCTRL_LAKEFIELD) += pinctrl-lakefield.o obj-$(CONFIG_PINCTRL_LAKEFIELD) += pinctrl-lakefield.o
obj-$(CONFIG_PINCTRL_LEWISBURG) += pinctrl-lewisburg.o obj-$(CONFIG_PINCTRL_LEWISBURG) += pinctrl-lewisburg.o
obj-$(CONFIG_PINCTRL_METEORLAKE) += pinctrl-meteorlake.o
obj-$(CONFIG_PINCTRL_SUNRISEPOINT) += pinctrl-sunrisepoint.o obj-$(CONFIG_PINCTRL_SUNRISEPOINT) += pinctrl-sunrisepoint.o
obj-$(CONFIG_PINCTRL_TIGERLAKE) += pinctrl-tigerlake.o obj-$(CONFIG_PINCTRL_TIGERLAKE) += pinctrl-tigerlake.o
...@@ -603,7 +603,7 @@ static const char *byt_get_group_name(struct pinctrl_dev *pctldev, ...@@ -603,7 +603,7 @@ static const char *byt_get_group_name(struct pinctrl_dev *pctldev,
{ {
struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev);
return vg->soc->groups[selector].name; return vg->soc->groups[selector].grp.name;
} }
static int byt_get_group_pins(struct pinctrl_dev *pctldev, static int byt_get_group_pins(struct pinctrl_dev *pctldev,
...@@ -613,8 +613,8 @@ static int byt_get_group_pins(struct pinctrl_dev *pctldev, ...@@ -613,8 +613,8 @@ static int byt_get_group_pins(struct pinctrl_dev *pctldev,
{ {
struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev);
*pins = vg->soc->groups[selector].pins; *pins = vg->soc->groups[selector].grp.pins;
*num_pins = vg->soc->groups[selector].npins; *num_pins = vg->soc->groups[selector].grp.npins;
return 0; return 0;
} }
...@@ -662,15 +662,15 @@ static void byt_set_group_simple_mux(struct intel_pinctrl *vg, ...@@ -662,15 +662,15 @@ static void byt_set_group_simple_mux(struct intel_pinctrl *vg,
raw_spin_lock_irqsave(&byt_lock, flags); raw_spin_lock_irqsave(&byt_lock, flags);
for (i = 0; i < group.npins; i++) { for (i = 0; i < group.grp.npins; i++) {
void __iomem *padcfg0; void __iomem *padcfg0;
u32 value; u32 value;
padcfg0 = byt_gpio_reg(vg, group.pins[i], BYT_CONF0_REG); padcfg0 = byt_gpio_reg(vg, group.grp.pins[i], BYT_CONF0_REG);
if (!padcfg0) { if (!padcfg0) {
dev_warn(vg->dev, dev_warn(vg->dev,
"Group %s, pin %i not muxed (no padcfg0)\n", "Group %s, pin %i not muxed (no padcfg0)\n",
group.name, i); group.grp.name, i);
continue; continue;
} }
...@@ -692,15 +692,15 @@ static void byt_set_group_mixed_mux(struct intel_pinctrl *vg, ...@@ -692,15 +692,15 @@ static void byt_set_group_mixed_mux(struct intel_pinctrl *vg,
raw_spin_lock_irqsave(&byt_lock, flags); raw_spin_lock_irqsave(&byt_lock, flags);
for (i = 0; i < group.npins; i++) { for (i = 0; i < group.grp.npins; i++) {
void __iomem *padcfg0; void __iomem *padcfg0;
u32 value; u32 value;
padcfg0 = byt_gpio_reg(vg, group.pins[i], BYT_CONF0_REG); padcfg0 = byt_gpio_reg(vg, group.grp.pins[i], BYT_CONF0_REG);
if (!padcfg0) { if (!padcfg0) {
dev_warn(vg->dev, dev_warn(vg->dev,
"Group %s, pin %i not muxed (no padcfg0)\n", "Group %s, pin %i not muxed (no padcfg0)\n",
group.name, i); group.grp.name, i);
continue; continue;
} }
......
...@@ -627,7 +627,7 @@ static const char *chv_get_group_name(struct pinctrl_dev *pctldev, ...@@ -627,7 +627,7 @@ static const char *chv_get_group_name(struct pinctrl_dev *pctldev,
{ {
struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
return pctrl->soc->groups[group].name; return pctrl->soc->groups[group].grp.name;
} }
static int chv_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, static int chv_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group,
...@@ -635,8 +635,8 @@ static int chv_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, ...@@ -635,8 +635,8 @@ static int chv_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group,
{ {
struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
*pins = pctrl->soc->groups[group].pins; *pins = pctrl->soc->groups[group].grp.pins;
*npins = pctrl->soc->groups[group].npins; *npins = pctrl->soc->groups[group].grp.npins;
return 0; return 0;
} }
...@@ -721,16 +721,16 @@ static int chv_pinmux_set_mux(struct pinctrl_dev *pctldev, ...@@ -721,16 +721,16 @@ static int chv_pinmux_set_mux(struct pinctrl_dev *pctldev,
raw_spin_lock_irqsave(&chv_lock, flags); raw_spin_lock_irqsave(&chv_lock, flags);
/* Check first that the pad is not locked */ /* Check first that the pad is not locked */
for (i = 0; i < grp->npins; i++) { for (i = 0; i < grp->grp.npins; i++) {
if (chv_pad_locked(pctrl, grp->pins[i])) { if (chv_pad_locked(pctrl, grp->grp.pins[i])) {
raw_spin_unlock_irqrestore(&chv_lock, flags); raw_spin_unlock_irqrestore(&chv_lock, flags);
dev_warn(dev, "unable to set mode for locked pin %u\n", grp->pins[i]); dev_warn(dev, "unable to set mode for locked pin %u\n", grp->grp.pins[i]);
return -EBUSY; return -EBUSY;
} }
} }
for (i = 0; i < grp->npins; i++) { for (i = 0; i < grp->grp.npins; i++) {
int pin = grp->pins[i]; int pin = grp->grp.pins[i];
unsigned int mode; unsigned int mode;
bool invert_oe; bool invert_oe;
u32 value; u32 value;
......
...@@ -279,7 +279,7 @@ static const char *intel_get_group_name(struct pinctrl_dev *pctldev, ...@@ -279,7 +279,7 @@ static const char *intel_get_group_name(struct pinctrl_dev *pctldev,
{ {
struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
return pctrl->soc->groups[group].name; return pctrl->soc->groups[group].grp.name;
} }
static int intel_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, static int intel_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group,
...@@ -287,8 +287,8 @@ static int intel_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, ...@@ -287,8 +287,8 @@ static int intel_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group,
{ {
struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
*pins = pctrl->soc->groups[group].pins; *pins = pctrl->soc->groups[group].grp.pins;
*npins = pctrl->soc->groups[group].npins; *npins = pctrl->soc->groups[group].grp.npins;
return 0; return 0;
} }
...@@ -391,19 +391,19 @@ static int intel_pinmux_set_mux(struct pinctrl_dev *pctldev, ...@@ -391,19 +391,19 @@ static int intel_pinmux_set_mux(struct pinctrl_dev *pctldev,
* All pins in the groups needs to be accessible and writable * All pins in the groups needs to be accessible and writable
* before we can enable the mux for this group. * before we can enable the mux for this group.
*/ */
for (i = 0; i < grp->npins; i++) { for (i = 0; i < grp->grp.npins; i++) {
if (!intel_pad_usable(pctrl, grp->pins[i])) { if (!intel_pad_usable(pctrl, grp->grp.pins[i])) {
raw_spin_unlock_irqrestore(&pctrl->lock, flags); raw_spin_unlock_irqrestore(&pctrl->lock, flags);
return -EBUSY; return -EBUSY;
} }
} }
/* Now enable the mux setting for each pin in the group */ /* Now enable the mux setting for each pin in the group */
for (i = 0; i < grp->npins; i++) { for (i = 0; i < grp->grp.npins; i++) {
void __iomem *padcfg0; void __iomem *padcfg0;
u32 value; u32 value;
padcfg0 = intel_get_padcfg(pctrl, grp->pins[i], PADCFG0); padcfg0 = intel_get_padcfg(pctrl, grp->grp.pins[i], PADCFG0);
value = readl(padcfg0); value = readl(padcfg0);
value &= ~PADCFG0_PMODE_MASK; value &= ~PADCFG0_PMODE_MASK;
......
...@@ -24,17 +24,12 @@ struct device; ...@@ -24,17 +24,12 @@ struct device;
/** /**
* struct intel_pingroup - Description about group of pins * struct intel_pingroup - Description about group of pins
* @name: Name of the groups * @grp: Generic data of the pin group (name and pins)
* @pins: All pins in this group * @mode: Native mode in which the group is muxed out @pins. Used if @modes is %NULL.
* @npins: Number of pins in this groups
* @mode: Native mode in which the group is muxed out @pins. Used if @modes
* is %NULL.
* @modes: If not %NULL this will hold mode for each pin in @pins * @modes: If not %NULL this will hold mode for each pin in @pins
*/ */
struct intel_pingroup { struct intel_pingroup {
const char *name; struct pingroup grp;
const unsigned int *pins;
size_t npins;
unsigned short mode; unsigned short mode;
const unsigned int *modes; const unsigned int *modes;
}; };
...@@ -156,15 +151,11 @@ struct intel_community { ...@@ -156,15 +151,11 @@ struct intel_community {
* a single integer or an array of integers in which case mode is per * a single integer or an array of integers in which case mode is per
* pin. * pin.
*/ */
#define PIN_GROUP(n, p, m) \ #define PIN_GROUP(n, p, m) \
{ \ { \
.name = (n), \ .grp = PINCTRL_PINGROUP((n), (p), ARRAY_SIZE((p))), \
.pins = (p), \ .mode = __builtin_choose_expr(__builtin_constant_p((m)), (m), 0), \
.npins = ARRAY_SIZE((p)), \ .modes = __builtin_choose_expr(__builtin_constant_p((m)), NULL, (m)), \
.mode = __builtin_choose_expr( \
__builtin_constant_p((m)), (m), 0), \
.modes = __builtin_choose_expr( \
__builtin_constant_p((m)), NULL, (m)), \
} }
#define FUNCTION(n, g) \ #define FUNCTION(n, g) \
......
...@@ -282,7 +282,7 @@ static const char *lp_get_group_name(struct pinctrl_dev *pctldev, ...@@ -282,7 +282,7 @@ static const char *lp_get_group_name(struct pinctrl_dev *pctldev,
{ {
struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev);
return lg->soc->groups[selector].name; return lg->soc->groups[selector].grp.name;
} }
static int lp_get_group_pins(struct pinctrl_dev *pctldev, static int lp_get_group_pins(struct pinctrl_dev *pctldev,
...@@ -292,8 +292,8 @@ static int lp_get_group_pins(struct pinctrl_dev *pctldev, ...@@ -292,8 +292,8 @@ static int lp_get_group_pins(struct pinctrl_dev *pctldev,
{ {
struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev);
*pins = lg->soc->groups[selector].pins; *pins = lg->soc->groups[selector].grp.pins;
*num_pins = lg->soc->groups[selector].npins; *num_pins = lg->soc->groups[selector].grp.npins;
return 0; return 0;
} }
...@@ -366,8 +366,8 @@ static int lp_pinmux_set_mux(struct pinctrl_dev *pctldev, ...@@ -366,8 +366,8 @@ static int lp_pinmux_set_mux(struct pinctrl_dev *pctldev,
raw_spin_lock_irqsave(&lg->lock, flags); raw_spin_lock_irqsave(&lg->lock, flags);
/* Now enable the mux setting for each pin in the group */ /* Now enable the mux setting for each pin in the group */
for (i = 0; i < grp->npins; i++) { for (i = 0; i < grp->grp.npins; i++) {
void __iomem *reg = lp_gpio_reg(&lg->chip, grp->pins[i], LP_CONFIG1); void __iomem *reg = lp_gpio_reg(&lg->chip, grp->grp.pins[i], LP_CONFIG1);
u32 value; u32 value;
value = ioread32(reg); value = ioread32(reg);
......
...@@ -520,7 +520,7 @@ static const char *mrfld_get_group_name(struct pinctrl_dev *pctldev, ...@@ -520,7 +520,7 @@ static const char *mrfld_get_group_name(struct pinctrl_dev *pctldev,
{ {
struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev);
return mp->groups[group].name; return mp->groups[group].grp.name;
} }
static int mrfld_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, static int mrfld_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group,
...@@ -528,8 +528,8 @@ static int mrfld_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, ...@@ -528,8 +528,8 @@ static int mrfld_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group,
{ {
struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev);
*pins = mp->groups[group].pins; *pins = mp->groups[group].grp.pins;
*npins = mp->groups[group].npins; *npins = mp->groups[group].grp.npins;
return 0; return 0;
} }
...@@ -604,15 +604,15 @@ static int mrfld_pinmux_set_mux(struct pinctrl_dev *pctldev, ...@@ -604,15 +604,15 @@ static int mrfld_pinmux_set_mux(struct pinctrl_dev *pctldev,
* All pins in the groups needs to be accessible and writable * All pins in the groups needs to be accessible and writable
* before we can enable the mux for this group. * before we can enable the mux for this group.
*/ */
for (i = 0; i < grp->npins; i++) { for (i = 0; i < grp->grp.npins; i++) {
if (!mrfld_buf_available(mp, grp->pins[i])) if (!mrfld_buf_available(mp, grp->grp.pins[i]))
return -EBUSY; return -EBUSY;
} }
/* Now enable the mux setting for each pin in the group */ /* Now enable the mux setting for each pin in the group */
raw_spin_lock_irqsave(&mp->lock, flags); raw_spin_lock_irqsave(&mp->lock, flags);
for (i = 0; i < grp->npins; i++) for (i = 0; i < grp->grp.npins; i++)
mrfld_update_bufcfg(mp, grp->pins[i], bits, mask); mrfld_update_bufcfg(mp, grp->grp.pins[i], bits, mask);
raw_spin_unlock_irqrestore(&mp->lock, flags); raw_spin_unlock_irqrestore(&mp->lock, flags);
return 0; return 0;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment