| diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mcp23s08.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-mcp23s08.txt |
| index 2fa5edac7a35..4906544628ec 100644 |
| --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mcp23s08.txt |
| +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mcp23s08.txt |
| @@ -146,3 +146,38 @@ gpio21: gpio@21 { |
| bias-pull-up; |
| }; |
| }; |
| + |
| +Line naming |
| +=========== |
| + |
| +Because several gpio_chip instances are hidden below a single device tree |
| +node, it is necessary to split the names into several child nodes. Ensure |
| +that the configured addresses match those in the microchip,spi-present-mask: |
| + |
| +gpio@0 { |
| + compatible = "microchip,mcp23s17"; |
| + gpio-controller; |
| + #gpio-cells = <2>; |
| + /* this bitmask has bits #0 (0x01) and #2 (0x04) set */ |
| + spi-present-mask = <0x05>; |
| + reg = <0>; |
| + spi-max-frequency = <1000000>; |
| + |
| + gpio-bank@1 { |
| + address = <0>; |
| + gpio-line-names = |
| + "GPA0", |
| + "GPA1", |
| + ... |
| + "GPA7", |
| + "GPB0", |
| + "GPB1", |
| + ... |
| + "GPB7"; |
| + }; |
| + |
| + gpio-bank@2 { |
| + address = <2>; |
| + gpio-line-names = ... |
| + }; |
| +}; |
| diff --git a/arch/arm/boot/dts/marvell/armada-388-clearfog.dtsi b/arch/arm/boot/dts/marvell/armada-388-clearfog.dtsi |
| index f8a06ae4a3c9..e14020e653a1 100644 |
| --- a/arch/arm/boot/dts/marvell/armada-388-clearfog.dtsi |
| +++ b/arch/arm/boot/dts/marvell/armada-388-clearfog.dtsi |
| @@ -111,6 +111,12 @@ ð2 { |
| }; |
| |
| &i2c0 { |
| + pinctrl-0 = <&clearfog_i2c0_pins>; |
| + pinctrl-1 = <&clearfog_i2c0_recovery_pins>; |
| + pinctrl-names = "default", "gpio"; |
| + scl-gpios = <&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; |
| + sda-gpios = <&gpio0 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; |
| + |
| /* |
| * PCA9655 GPIO expander, up to 1MHz clock. |
| * 0-CON3 CLKREQ# |
| @@ -196,16 +202,32 @@ &i2c1 { |
| */ |
| clock-frequency = <100000>; |
| pinctrl-0 = <&clearfog_i2c1_pins>; |
| - pinctrl-names = "default"; |
| + pinctrl-1 = <&clearfog_i2c1_recovery_pins>; |
| + pinctrl-names = "default", "gpio"; |
| status = "okay"; |
| + single-master; |
| + scl-gpios = <&gpio0 26 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; |
| + sda-gpios = <&gpio0 27 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; |
| }; |
| |
| &pinctrl { |
| + clearfog_i2c0_pins: i2c0-pins { |
| + marvell,pins = "mpp2", "mpp3"; |
| + marvell,function = "i2c0"; |
| + }; |
| + clearfog_i2c0_recovery_pins: i2c0-recovery-pins { |
| + marvell,pins = "mpp2", "mpp3"; |
| + marvell,function = "gpio"; |
| + }; |
| clearfog_i2c1_pins: i2c1-pins { |
| /* SFP, PCIe, mSATA, mikrobus */ |
| marvell,pins = "mpp26", "mpp27"; |
| marvell,function = "i2c1"; |
| }; |
| + clearfog_i2c1_recovery_pins: i2c1-recovery-pins { |
| + marvell,pins = "mpp26", "mpp27"; |
| + marvell,function = "gpio"; |
| + }; |
| clearfog_sdhci_cd_pins: clearfog-sdhci-cd-pins { |
| marvell,pins = "mpp20"; |
| marvell,function = "gpio"; |
| diff --git a/drivers/hwmon/pmbus/fsp-3y.c b/drivers/hwmon/pmbus/fsp-3y.c |
| index 72a7c261ef06..2ca5613f10bf 100644 |
| --- a/drivers/hwmon/pmbus/fsp-3y.c |
| +++ b/drivers/hwmon/pmbus/fsp-3y.c |
| @@ -29,7 +29,7 @@ |
| #define YH5151E_PAGE_3V3_REAL 0x11 |
| |
| enum chips { |
| - ym2151e, |
| + ym2151, |
| yh5151e |
| }; |
| |
| @@ -46,7 +46,7 @@ struct fsp3y_data { |
| static int page_log_to_page_real(int page_log, enum chips chip) |
| { |
| switch (chip) { |
| - case ym2151e: |
| + case ym2151: |
| switch (page_log) { |
| case YM2151_PAGE_12V_LOG: |
| return YM2151_PAGE_12V_REAL; |
| @@ -170,7 +170,7 @@ static int fsp3y_read_word_data(struct i2c_client *client, int page, int phase, |
| } |
| |
| static struct pmbus_driver_info fsp3y_info[] = { |
| - [ym2151e] = { |
| + [ym2151] = { |
| .pages = 2, |
| .func[YM2151_PAGE_12V_LOG] = |
| PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT | |
| @@ -213,7 +213,9 @@ static int fsp3y_detect(struct i2c_client *client) |
| |
| if (rv == 8) { |
| if (!strcmp(buf, "YM-2151E")) |
| - return ym2151e; |
| + return ym2151; |
| + else if (!strcmp(buf, "YM-2151F")) |
| + return ym2151; |
| else if (!strcmp(buf, "YH-5151E")) |
| return yh5151e; |
| } |
| @@ -223,7 +225,8 @@ static int fsp3y_detect(struct i2c_client *client) |
| } |
| |
| static const struct i2c_device_id fsp3y_id[] = { |
| - {"ym2151e", ym2151e}, |
| + {"ym2151", ym2151}, |
| + {"ym2151e", ym2151}, |
| {"yh5151e", yh5151e}, |
| { } |
| }; |
| diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c |
| index 945e831ef4ac..682ad60970d0 100644 |
| --- a/drivers/leds/leds-tlc591xx.c |
| +++ b/drivers/leds/leds-tlc591xx.c |
| @@ -39,6 +39,9 @@ |
| |
| #define ldev_to_led(c) container_of(c, struct tlc591xx_led, ldev) |
| |
| +#define TLC591XX_RESET_BYTE_0 0xa5 |
| +#define TLC591XX_RESET_BYTE_1 0x5a |
| + |
| struct tlc591xx_led { |
| bool active; |
| unsigned int led_no; |
| @@ -50,21 +53,25 @@ struct tlc591xx_priv { |
| struct tlc591xx_led leds[TLC591XX_MAX_LEDS]; |
| struct regmap *regmap; |
| unsigned int reg_ledout_offset; |
| + struct i2c_client *swrst_client; |
| }; |
| |
| struct tlc591xx { |
| unsigned int max_leds; |
| unsigned int reg_ledout_offset; |
| + u8 swrst_addr; |
| }; |
| |
| static const struct tlc591xx tlc59116 = { |
| .max_leds = 16, |
| .reg_ledout_offset = 0x14, |
| + .swrst_addr = 0x6b, |
| }; |
| |
| static const struct tlc591xx tlc59108 = { |
| .max_leds = 8, |
| .reg_ledout_offset = 0x0c, |
| + .swrst_addr = 0x4b, |
| }; |
| |
| static int |
| @@ -178,6 +185,18 @@ tlc591xx_probe(struct i2c_client *client) |
| |
| i2c_set_clientdata(client, priv); |
| |
| + priv->swrst_client = devm_i2c_new_dummy_device(dev, client->adapter, tlc591xx->swrst_addr); |
| + if (IS_ERR(priv->swrst_client)) { |
| + dev_info(dev, "Skipping reset: address %02x already used\n", |
| + tlc591xx->swrst_addr); |
| + } else { |
| + err = i2c_smbus_write_byte_data(priv->swrst_client, |
| + TLC591XX_RESET_BYTE_0, TLC591XX_RESET_BYTE_1); |
| + if (err) { |
| + dev_warn(dev, "SW reset failed\n"); |
| + } |
| + } |
| + |
| err = tlc591xx_set_mode(priv->regmap, MODE2_DIM); |
| if (err < 0) |
| return err; |
| diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig |
| index 2a57328eca20..dc6816d36d06 100644 |
| --- a/drivers/leds/trigger/Kconfig |
| +++ b/drivers/leds/trigger/Kconfig |
| @@ -83,7 +83,6 @@ config LEDS_TRIGGER_ACTIVITY |
| config LEDS_TRIGGER_GPIO |
| tristate "LED GPIO Trigger" |
| depends on GPIOLIB || COMPILE_TEST |
| - depends on BROKEN |
| help |
| This allows LEDs to be controlled by gpio events. It's good |
| when using gpios as switches and triggering the needed LEDs |
| diff --git a/drivers/pinctrl/pinctrl-mcp23s08_spi.c b/drivers/pinctrl/pinctrl-mcp23s08_spi.c |
| index ea059b9c5542..d58c6e631942 100644 |
| --- a/drivers/pinctrl/pinctrl-mcp23s08_spi.c |
| +++ b/drivers/pinctrl/pinctrl-mcp23s08_spi.c |
| @@ -8,6 +8,7 @@ |
| #include <linux/spi/spi.h> |
| |
| #include "pinctrl-mcp23s08.h" |
| +#include "../gpio/gpiolib.h" |
| |
| #define MCP_MAX_DEV_PER_CS 8 |
| |
| @@ -153,6 +154,10 @@ static int mcp23s08_probe(struct spi_device *spi) |
| int type; |
| int ret; |
| u32 v; |
| + struct device_node *np; |
| + int line_name_count; |
| + const char **names; |
| + int i; |
| |
| match = device_get_match_data(dev); |
| if (match) |
| @@ -202,6 +207,43 @@ static int mcp23s08_probe(struct spi_device *spi) |
| return ret; |
| |
| ngpio += data->mcp[addr]->chip.ngpio; |
| + |
| + for_each_available_child_of_node(spi->dev.of_node, np) { |
| + u32 chip_addr; |
| + ret = of_property_read_u32(np, "address", &chip_addr); |
| + if (ret) |
| + continue; |
| + if (chip_addr != addr) |
| + continue; |
| + |
| + line_name_count = fwnode_property_read_string_array(of_fwnode_handle(np), "gpio-line-names", NULL, 0); |
| + if (line_name_count < 0) |
| + continue; |
| + |
| + if (line_name_count > data->mcp[addr]->chip.ngpio) { |
| + dev_warn(&spi->dev, "gpio-line-names is length %d but should be at most length %d", |
| + line_name_count, data->mcp[addr]->chip.ngpio); |
| + line_name_count = data->mcp[addr]->chip.ngpio; |
| + } |
| + |
| + names = kcalloc(line_name_count, sizeof(*names), GFP_KERNEL); |
| + if (!names) { |
| + dev_warn(&spi->dev, "cannot allocate gpio-line-names"); |
| + continue; |
| + } |
| + |
| + ret = fwnode_property_read_string_array(of_fwnode_handle(np), "gpio-line-names", names, line_name_count); |
| + if (ret < 0) { |
| + dev_warn(&spi->dev, "failed to read GPIO line names"); |
| + kfree(names); |
| + continue; |
| + } |
| + |
| + for (i = 0; i < line_name_count; i++) |
| + data->mcp[addr]->chip.gpiodev->descs[i].name = names[i]; |
| + |
| + kfree(names); |
| + } |
| } |
| data->ngpio = ngpio; |
| |
| diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c |
| index 1f10f5c8e34d..25bde84af1cc 100644 |
| --- a/drivers/spi/spi-orion.c |
| +++ b/drivers/spi/spi-orion.c |
| @@ -472,7 +472,7 @@ orion_spi_write_read(struct spi_device *spi, struct spi_transfer *xfer) |
| int cs = spi_get_chipselect(spi, 0); |
| void __iomem *vaddr; |
| |
| - word_len = spi->bits_per_word; |
| + word_len = xfer->bits_per_word; |
| count = xfer->len; |
| |
| orion_spi = spi_controller_get_devdata(spi->controller); |
| diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c |
| index e339abff926d..2a74aab60d79 100644 |
| --- a/drivers/tty/serial/max310x.c |
| +++ b/drivers/tty/serial/max310x.c |
| @@ -27,9 +27,11 @@ |
| #include <linux/uaccess.h> |
| |
| #define MAX310X_NAME "max310x" |
| +#define MAX310X_PORT_NAME_SUFFIX "port" |
| #define MAX310X_MAJOR 204 |
| #define MAX310X_MINOR 209 |
| #define MAX310X_UART_NRMAX 16 |
| +#define MAX310X_MAX_PORTS 4 /* Maximum number of UART ports per IC. */ |
| |
| /* MAX310X register definitions */ |
| #define MAX310X_RHR_REG (0x00) /* RX FIFO */ |
| @@ -1518,6 +1520,15 @@ static struct regmap_config regcfg = { |
| .max_raw_write = MAX310X_FIFO_SIZE, |
| }; |
| |
| +static const char *max310x_regmap_name(unsigned int port_id) |
| +{ |
| + static char buf[sizeof(MAX310X_PORT_NAME_SUFFIX __stringify(MAX310X_MAX_PORTS))]; |
| + |
| + snprintf(buf, sizeof(buf), MAX310X_PORT_NAME_SUFFIX "%u", port_id); |
| + |
| + return buf; |
| +} |
| + |
| #ifdef CONFIG_SPI_MASTER |
| static int max310x_spi_extended_reg_enable(struct device *dev, bool enable) |
| { |
| @@ -1535,7 +1546,7 @@ static const struct max310x_if_cfg __maybe_unused max310x_spi_if_cfg = { |
| static int max310x_spi_probe(struct spi_device *spi) |
| { |
| const struct max310x_devtype *devtype; |
| - struct regmap *regmaps[4]; |
| + struct regmap *regmaps[MAX310X_MAX_PORTS]; |
| unsigned int i; |
| int ret; |
| |
| @@ -1553,6 +1564,8 @@ static int max310x_spi_probe(struct spi_device *spi) |
| |
| for (i = 0; i < devtype->nr; i++) { |
| u8 port_mask = i * 0x20; |
| + |
| + regcfg.name = max310x_regmap_name(i); |
| regcfg.read_flag_mask = port_mask; |
| regcfg.write_flag_mask = port_mask | MAX310X_WRITE_BIT; |
| regmaps[i] = devm_regmap_init_spi(spi, ®cfg); |
| @@ -1637,7 +1650,7 @@ static int max310x_i2c_probe(struct i2c_client *client) |
| { |
| const struct max310x_devtype *devtype; |
| struct i2c_client *port_client; |
| - struct regmap *regmaps[4]; |
| + struct regmap *regmaps[MAX310X_MAX_PORTS]; |
| unsigned int i; |
| u8 port_addr; |
| |
| @@ -1652,6 +1665,7 @@ static int max310x_i2c_probe(struct i2c_client *client) |
| client->addr, devtype->slave_addr.min, |
| devtype->slave_addr.max); |
| |
| + regcfg_i2c.name = max310x_regmap_name(0); |
| regmaps[0] = devm_regmap_init_i2c(client, ®cfg_i2c); |
| |
| for (i = 1; i < devtype->nr; i++) { |
| @@ -1660,6 +1674,7 @@ static int max310x_i2c_probe(struct i2c_client *client) |
| client->adapter, |
| port_addr); |
| |
| + regcfg_i2c.name = max310x_regmap_name(i); |
| regmaps[i] = devm_regmap_init_i2c(port_client, ®cfg_i2c); |
| } |
| |
| diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf |
| index b97224a8a65b..00f43dd9edaf 100644 |
| --- a/tools/perf/Makefile.perf |
| +++ b/tools/perf/Makefile.perf |
| @@ -188,7 +188,7 @@ HOSTLD ?= ld |
| HOSTAR ?= ar |
| CLANG ?= clang |
| |
| -PKG_CONFIG = $(CROSS_COMPILE)pkg-config |
| +PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config |
| |
| RM = rm -f |
| LN = ln -f |