Commit 8d31f80e authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pinctrl-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:
 "These are the pin control fixes I have gathered since the return from
  my vacation. They boiled in -next a while so let's get them in.

  Apart from the documentation build it is purely driver fixes. Which is
  nice. The Intel fixes seem kind of important.

   - Fix the documentation build as the docs were moved

   - Correct the UART pin list on the Intel Merrifield

   - Fix pin assignment and number of pins on the Marvell Armada 37xx
     pin controller

   - Cover the Setzer models in the Chromebook DMI quirk in the Intel
     cheryview driver so they start working

   - Add the missing "sim" function to the sunxi driver

   - Fix USB pin definitions on Uniphier Pro4

   - Smatch fix for invalid reference in the zx pin control driver"

* tag 'pinctrl-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: generic: update references to Documentation/pinctrl.txt
  pinctrl: intel: merrifield: Correct UART pin lists
  pinctrl: armada-37xx: Fix number of pin in south bridge
  pinctrl: armada-37xx: Fix the pin 23 on south bridge
  pinctrl: cherryview: Add Setzer models to the Chromebook DMI quirk
  pinctrl: sunxi: add a missing function of A10/A20 pinctrl driver
  pinctrl: uniphier: fix USB3 pin assignment for Pro4
  pinctrl: zte: fix dereference of 'data' in zx_set_mux()
parents 48fb6f4d 0cca6c89
...@@ -459,7 +459,7 @@ pin controller? ...@@ -459,7 +459,7 @@ pin controller?
This is done by registering "ranges" of pins, which are essentially This is done by registering "ranges" of pins, which are essentially
cross-reference tables. These are described in cross-reference tables. These are described in
Documentation/pinctrl.txt Documentation/driver-api/pinctl.rst
While the pin allocation is totally managed by the pinctrl subsystem, While the pin allocation is totally managed by the pinctrl subsystem,
gpio (under gpiolib) is still maintained by gpio drivers. It may happen gpio (under gpiolib) is still maintained by gpio drivers. It may happen
......
...@@ -10383,7 +10383,7 @@ L: linux-gpio@vger.kernel.org ...@@ -10383,7 +10383,7 @@ L: linux-gpio@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git
S: Maintained S: Maintained
F: Documentation/devicetree/bindings/pinctrl/ F: Documentation/devicetree/bindings/pinctrl/
F: Documentation/pinctrl.txt F: Documentation/driver-api/pinctl.rst
F: drivers/pinctrl/ F: drivers/pinctrl/
F: include/linux/pinctrl/ F: include/linux/pinctrl/
......
...@@ -1547,6 +1547,13 @@ static const struct dmi_system_id chv_no_valid_mask[] = { ...@@ -1547,6 +1547,13 @@ static const struct dmi_system_id chv_no_valid_mask[] = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_Strago"), DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_Strago"),
}, },
}, },
{
.ident = "HP Chromebook 11 G5 (Setzer)",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
DMI_MATCH(DMI_PRODUCT_NAME, "Setzer"),
},
},
{ {
.ident = "Acer Chromebook R11 (Cyan)", .ident = "Acer Chromebook R11 (Cyan)",
.matches = { .matches = {
......
...@@ -343,9 +343,9 @@ static const struct pinctrl_pin_desc mrfld_pins[] = { ...@@ -343,9 +343,9 @@ static const struct pinctrl_pin_desc mrfld_pins[] = {
static const unsigned int mrfld_sdio_pins[] = { 50, 51, 52, 53, 54, 55, 56 }; static const unsigned int mrfld_sdio_pins[] = { 50, 51, 52, 53, 54, 55, 56 };
static const unsigned int mrfld_spi5_pins[] = { 90, 91, 92, 93, 94, 95, 96 }; static const unsigned int mrfld_spi5_pins[] = { 90, 91, 92, 93, 94, 95, 96 };
static const unsigned int mrfld_uart0_pins[] = { 124, 125, 126, 127 }; static const unsigned int mrfld_uart0_pins[] = { 115, 116, 117, 118 };
static const unsigned int mrfld_uart1_pins[] = { 128, 129, 130, 131 }; static const unsigned int mrfld_uart1_pins[] = { 119, 120, 121, 122 };
static const unsigned int mrfld_uart2_pins[] = { 132, 133, 134, 135 }; static const unsigned int mrfld_uart2_pins[] = { 123, 124, 125, 126 };
static const unsigned int mrfld_pwm0_pins[] = { 144 }; static const unsigned int mrfld_pwm0_pins[] = { 144 };
static const unsigned int mrfld_pwm1_pins[] = { 145 }; static const unsigned int mrfld_pwm1_pins[] = { 145 };
static const unsigned int mrfld_pwm2_pins[] = { 132 }; static const unsigned int mrfld_pwm2_pins[] = { 132 };
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#define IRQ_STATUS 0x10 #define IRQ_STATUS 0x10
#define IRQ_WKUP 0x18 #define IRQ_WKUP 0x18
#define NB_FUNCS 2 #define NB_FUNCS 3
#define GPIO_PER_REG 32 #define GPIO_PER_REG 32
/** /**
...@@ -126,6 +126,16 @@ struct armada_37xx_pinctrl { ...@@ -126,6 +126,16 @@ struct armada_37xx_pinctrl {
.funcs = {_func1, "gpio"} \ .funcs = {_func1, "gpio"} \
} }
#define PIN_GRP_GPIO_3(_name, _start, _nr, _mask, _v1, _v2, _v3, _f1, _f2) \
{ \
.name = _name, \
.start_pin = _start, \
.npins = _nr, \
.reg_mask = _mask, \
.val = {_v1, _v2, _v3}, \
.funcs = {_f1, _f2, "gpio"} \
}
#define PIN_GRP_EXTRA(_name, _start, _nr, _mask, _v1, _v2, _start2, _nr2, \ #define PIN_GRP_EXTRA(_name, _start, _nr, _mask, _v1, _v2, _start2, _nr2, \
_f1, _f2) \ _f1, _f2) \
{ \ { \
...@@ -171,12 +181,13 @@ static struct armada_37xx_pin_group armada_37xx_sb_groups[] = { ...@@ -171,12 +181,13 @@ static struct armada_37xx_pin_group armada_37xx_sb_groups[] = {
PIN_GRP_GPIO("usb32_drvvbus0", 0, 1, BIT(0), "drvbus"), PIN_GRP_GPIO("usb32_drvvbus0", 0, 1, BIT(0), "drvbus"),
PIN_GRP_GPIO("usb2_drvvbus1", 1, 1, BIT(1), "drvbus"), PIN_GRP_GPIO("usb2_drvvbus1", 1, 1, BIT(1), "drvbus"),
PIN_GRP_GPIO("sdio_sb", 24, 6, BIT(2), "sdio"), PIN_GRP_GPIO("sdio_sb", 24, 6, BIT(2), "sdio"),
PIN_GRP_EXTRA("rgmii", 6, 12, BIT(3), 0, BIT(3), 23, 1, "mii", "gpio"), PIN_GRP_GPIO("rgmii", 6, 12, BIT(3), "mii"),
PIN_GRP_GPIO("pcie1", 3, 2, BIT(4), "pcie"), PIN_GRP_GPIO("pcie1", 3, 2, BIT(4), "pcie"),
PIN_GRP_GPIO("ptp", 20, 3, BIT(5), "ptp"), PIN_GRP_GPIO("ptp", 20, 3, BIT(5), "ptp"),
PIN_GRP("ptp_clk", 21, 1, BIT(6), "ptp", "mii"), PIN_GRP("ptp_clk", 21, 1, BIT(6), "ptp", "mii"),
PIN_GRP("ptp_trig", 22, 1, BIT(7), "ptp", "mii"), PIN_GRP("ptp_trig", 22, 1, BIT(7), "ptp", "mii"),
PIN_GRP("mii_col", 23, 1, BIT(8), "mii", "mii_err"), PIN_GRP_GPIO_3("mii_col", 23, 1, BIT(8) | BIT(14), 0, BIT(8), BIT(14),
"mii", "mii_err"),
}; };
const struct armada_37xx_pin_data armada_37xx_pin_nb = { const struct armada_37xx_pin_data armada_37xx_pin_nb = {
...@@ -187,7 +198,7 @@ const struct armada_37xx_pin_data armada_37xx_pin_nb = { ...@@ -187,7 +198,7 @@ const struct armada_37xx_pin_data armada_37xx_pin_nb = {
}; };
const struct armada_37xx_pin_data armada_37xx_pin_sb = { const struct armada_37xx_pin_data armada_37xx_pin_sb = {
.nr_pins = 29, .nr_pins = 30,
.name = "GPIO2", .name = "GPIO2",
.groups = armada_37xx_sb_groups, .groups = armada_37xx_sb_groups,
.ngroups = ARRAY_SIZE(armada_37xx_sb_groups), .ngroups = ARRAY_SIZE(armada_37xx_sb_groups),
...@@ -208,7 +219,7 @@ static int armada_37xx_get_func_reg(struct armada_37xx_pin_group *grp, ...@@ -208,7 +219,7 @@ static int armada_37xx_get_func_reg(struct armada_37xx_pin_group *grp,
{ {
int f; int f;
for (f = 0; f < NB_FUNCS; f++) for (f = 0; (f < NB_FUNCS) && grp->funcs[f]; f++)
if (!strcmp(grp->funcs[f], func)) if (!strcmp(grp->funcs[f], func))
return f; return f;
...@@ -795,7 +806,7 @@ static int armada_37xx_fill_group(struct armada_37xx_pinctrl *info) ...@@ -795,7 +806,7 @@ static int armada_37xx_fill_group(struct armada_37xx_pinctrl *info)
for (j = 0; j < grp->extra_npins; j++) for (j = 0; j < grp->extra_npins; j++)
grp->pins[i+j] = grp->extra_pin + j; grp->pins[i+j] = grp->extra_pin + j;
for (f = 0; f < NB_FUNCS; f++) { for (f = 0; (f < NB_FUNCS) && grp->funcs[f]; f++) {
int ret; int ret;
/* check for unique functions and count groups */ /* check for unique functions and count groups */
ret = armada_37xx_add_function(info->funcs, &funcsize, ret = armada_37xx_add_function(info->funcs, &funcsize,
...@@ -847,7 +858,7 @@ static int armada_37xx_fill_func(struct armada_37xx_pinctrl *info) ...@@ -847,7 +858,7 @@ static int armada_37xx_fill_func(struct armada_37xx_pinctrl *info)
struct armada_37xx_pin_group *gp = &info->groups[g]; struct armada_37xx_pin_group *gp = &info->groups[g];
int f; int f;
for (f = 0; f < NB_FUNCS; f++) { for (f = 0; (f < NB_FUNCS) && gp->funcs[f]; f++) {
if (strcmp(gp->funcs[f], name) == 0) { if (strcmp(gp->funcs[f], name) == 0) {
*groups = gp->name; *groups = gp->name;
groups++; groups++;
......
...@@ -918,6 +918,7 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = { ...@@ -918,6 +918,7 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD1 */ SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD1 */
PINCTRL_SUN7I_A20), PINCTRL_SUN7I_A20),
SUNXI_FUNCTION(0x4, "keypad"), /* IN6 */ SUNXI_FUNCTION(0x4, "keypad"), /* IN6 */
SUNXI_FUNCTION(0x5, "sim"), /* DET */
SUNXI_FUNCTION_IRQ(0x6, 16), /* EINT16 */ SUNXI_FUNCTION_IRQ(0x6, 16), /* EINT16 */
SUNXI_FUNCTION(0x7, "csi1")), /* D16 */ SUNXI_FUNCTION(0x7, "csi1")), /* D16 */
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 17), SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 17),
......
...@@ -1084,7 +1084,7 @@ static const unsigned usb1_pins[] = {182, 183}; ...@@ -1084,7 +1084,7 @@ static const unsigned usb1_pins[] = {182, 183};
static const int usb1_muxvals[] = {0, 0}; static const int usb1_muxvals[] = {0, 0};
static const unsigned usb2_pins[] = {184, 185}; static const unsigned usb2_pins[] = {184, 185};
static const int usb2_muxvals[] = {0, 0}; static const int usb2_muxvals[] = {0, 0};
static const unsigned usb3_pins[] = {186, 187}; static const unsigned usb3_pins[] = {187, 188};
static const int usb3_muxvals[] = {0, 0}; static const int usb3_muxvals[] = {0, 0};
static const unsigned port_range0_pins[] = { static const unsigned port_range0_pins[] = {
300, 301, 302, 303, 304, 305, 306, 307, /* PORT0x */ 300, 301, 302, 303, 304, 305, 306, 307, /* PORT0x */
......
...@@ -64,10 +64,8 @@ static int zx_set_mux(struct pinctrl_dev *pctldev, unsigned int func_selector, ...@@ -64,10 +64,8 @@ static int zx_set_mux(struct pinctrl_dev *pctldev, unsigned int func_selector,
struct zx_pinctrl_soc_info *info = zpctl->info; struct zx_pinctrl_soc_info *info = zpctl->info;
const struct pinctrl_pin_desc *pindesc = info->pins + group_selector; const struct pinctrl_pin_desc *pindesc = info->pins + group_selector;
struct zx_pin_data *data = pindesc->drv_data; struct zx_pin_data *data = pindesc->drv_data;
struct zx_mux_desc *mux = data->muxes; struct zx_mux_desc *mux;
u32 mask = (1 << data->width) - 1; u32 mask, offset, bitpos;
u32 offset = data->offset;
u32 bitpos = data->bitpos;
struct function_desc *func; struct function_desc *func;
unsigned long flags; unsigned long flags;
u32 val, mval; u32 val, mval;
...@@ -76,6 +74,11 @@ static int zx_set_mux(struct pinctrl_dev *pctldev, unsigned int func_selector, ...@@ -76,6 +74,11 @@ static int zx_set_mux(struct pinctrl_dev *pctldev, unsigned int func_selector,
if (!data) if (!data)
return -EINVAL; return -EINVAL;
mux = data->muxes;
mask = (1 << data->width) - 1;
offset = data->offset;
bitpos = data->bitpos;
func = pinmux_generic_get_function(pctldev, func_selector); func = pinmux_generic_get_function(pctldev, func_selector);
if (!func) if (!func)
return -EINVAL; return -EINVAL;
......
...@@ -843,7 +843,7 @@ struct dev_links_info { ...@@ -843,7 +843,7 @@ struct dev_links_info {
* hibernation, system resume and during runtime PM transitions * hibernation, system resume and during runtime PM transitions
* along with subsystem-level and driver-level callbacks. * along with subsystem-level and driver-level callbacks.
* @pins: For device pin management. * @pins: For device pin management.
* See Documentation/pinctrl.txt for details. * See Documentation/driver-api/pinctl.rst for details.
* @msi_list: Hosts MSI descriptors * @msi_list: Hosts MSI descriptors
* @msi_domain: The generic MSI domain this device is using. * @msi_domain: The generic MSI domain this device is using.
* @numa_node: NUMA node this device is close to. * @numa_node: NUMA node this device is close to.
......
...@@ -81,8 +81,8 @@ ...@@ -81,8 +81,8 @@
* it. * it.
* @PIN_CONFIG_OUTPUT: this will configure the pin as an output and drive a * @PIN_CONFIG_OUTPUT: this will configure the pin as an output and drive a
* value on the line. Use argument 1 to indicate high level, argument 0 to * value on the line. Use argument 1 to indicate high level, argument 0 to
* indicate low level. (Please see Documentation/pinctrl.txt, section * indicate low level. (Please see Documentation/driver-api/pinctl.rst,
* "GPIO mode pitfalls" for a discussion around this parameter.) * section "GPIO mode pitfalls" for a discussion around this parameter.)
* @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power
* supplies, the argument to this parameter (on a custom format) tells * supplies, the argument to this parameter (on a custom format) tells
* the driver which alternative power source to use. * the driver which alternative power source to use.
......
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