diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-12-16 14:48:32 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-12-16 14:48:32 -0800 |
commit | 278f54c46164e9859090dde7e4ceede830c6beb6 (patch) | |
tree | 8b4e8d9ac4ad87c599701f3595bf40ed6b20c588 /drivers | |
parent | fff875a18382f1983b4a27be9282e697dbccb3db (diff) | |
parent | 0cd3aa995740eabf8af1c794ac1d9ae314c928c3 (diff) |
Merge tag 'mfd-next-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones:
"New Drivers
- Add support for Intel's Platform Monitoring Technology (PMT)
New Device Support:
- Add support for PM660/PM660L to QCom SPMI PMIC
- Add support for lots of new devices to Kontron Core
New Functionality:
- Provide syscon_regmap_lookup_by_phandle_optional() to SysCon API
Fix-ups:
- Constify; da9xxx-core; intel_*, tps65xxx, wm8xxx-core, lp8788,
stmpe, sun4i-gpadc, 88pm800, hi655x-pmic, ioc3, etc
- Remove superfluous code; madera, tps65910
- Use raw APIs (rid abstractions); tps65911-comparator, tps65910
- Whitespace/formatting fix-ups; tps65910
- Device Tree changes/updates; bd71837-pmic, syscon
- Use helpers/APIs (no hand rolling); altera-sysmgr
- Mark of_match tables as __maybe_unused; twl6030-irq
- Fix spelling; si476x-core
Bug Fixes:
- Reset on resume to ensure known state; madera-core
- Correct ordering issues; madera-core, tps65910, kempld-core
- Remove erroneous passing of of_compatible strings; at91-usart
- Fix potential I2C adaptor leak; htc-i2cpld
- Correct errorneous defines; rt5033-private
- Resolve Kconfig issues; MFD_SL28CPLD, MFD_OMAP_USB_HOST
- Fix dev_err_probe() handling; stmfx
- Repair interrupt regression; motorola-cpcap
- Allow ACPI matching of DT tables; bcm590xx, da9xx, ene-kb3930,
fsl-imx25-tsadc, max77650, mt6397-core, rt5033, stmfx, max77686,
sun4i-gpadc, wm8994-core, axp20x-i2c"
[ The PMT updates already came in through the x86 platform tree ]
* tag 'mfd-next-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (48 commits)
mfd: kempld-core: Add support for additional devices
mfd: si476x-core.h: Fix "regulator" spelling in comment
mfd: twl6030: Mark of_device_id table as maybe unused
mfd: axp20x: Skip of_device_id table when !CONFIG_OF
mfd: wm8994: Drop of_match_ptr from of_device_id table
mfd: sun4i: Drop of_match_ptr from of_device_id table
mfd: max77686: Drop of_match_ptr from of_device_id table
mfd: stmfx: Drop of_match_ptr from of_device_id table
mfd: rt5033: Drop of_match_ptr from of_device_id table
mfd: mt6397: Drop of_match_ptr from of_device_id table
mfd: max77650: Drop of_match_ptr from of_device_id table
mfd: fsl-imx25: Drop of_match_ptr from of_device_id table
mfd: ene-kb3930: Drop of_match_ptr from of_device_id table
mfd: da9150: Drop of_match_ptr from of_device_id table
mfd: da9063: Drop of_match_ptr from of_device_id table
mfd: da9062: Drop of_match_ptr from of_device_id table
mfd: da9055: Drop of_match_ptr from of_device_id table
mfd: bcm590xx: Drop of_match_ptr from of_device_id table
mfd: omap-usb: Depend on COMMON_CLK to fix compile tests
mfd: kempld-core: Check for DMI definition before ACPI
...
Diffstat (limited to 'drivers')
54 files changed, 373 insertions, 284 deletions
diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c index 0c785b0fd161..0c0b445c75c0 100644 --- a/drivers/gpio/gpio-tps65910.c +++ b/drivers/gpio/gpio-tps65910.c @@ -28,7 +28,7 @@ static int tps65910_gpio_get(struct gpio_chip *gc, unsigned offset) struct tps65910 *tps65910 = tps65910_gpio->tps65910; unsigned int val; - tps65910_reg_read(tps65910, TPS65910_GPIO0 + offset, &val); + regmap_read(tps65910->regmap, TPS65910_GPIO0 + offset, &val); if (val & GPIO_STS_MASK) return 1; @@ -43,10 +43,10 @@ static void tps65910_gpio_set(struct gpio_chip *gc, unsigned offset, struct tps65910 *tps65910 = tps65910_gpio->tps65910; if (value) - tps65910_reg_set_bits(tps65910, TPS65910_GPIO0 + offset, + regmap_set_bits(tps65910->regmap, TPS65910_GPIO0 + offset, GPIO_SET_MASK); else - tps65910_reg_clear_bits(tps65910, TPS65910_GPIO0 + offset, + regmap_clear_bits(tps65910->regmap, TPS65910_GPIO0 + offset, GPIO_SET_MASK); } @@ -59,7 +59,7 @@ static int tps65910_gpio_output(struct gpio_chip *gc, unsigned offset, /* Set the initial value */ tps65910_gpio_set(gc, offset, value); - return tps65910_reg_set_bits(tps65910, TPS65910_GPIO0 + offset, + return regmap_set_bits(tps65910->regmap, TPS65910_GPIO0 + offset, GPIO_CFG_MASK); } @@ -68,7 +68,7 @@ static int tps65910_gpio_input(struct gpio_chip *gc, unsigned offset) struct tps65910_gpio *tps65910_gpio = gpiochip_get_data(gc); struct tps65910 *tps65910 = tps65910_gpio->tps65910; - return tps65910_reg_clear_bits(tps65910, TPS65910_GPIO0 + offset, + return regmap_clear_bits(tps65910->regmap, TPS65910_GPIO0 + offset, GPIO_CFG_MASK); } @@ -157,7 +157,7 @@ static int tps65910_gpio_probe(struct platform_device *pdev) if (!pdata->en_gpio_sleep[i]) continue; - ret = tps65910_reg_set_bits(tps65910, + ret = regmap_set_bits(tps65910->regmap, TPS65910_GPIO0 + i, GPIO_SLEEP_MASK); if (ret < 0) dev_warn(tps65910->dev, diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c index 4e8d0d6b9b5c..c7f964996a91 100644 --- a/drivers/mfd/88pm800.c +++ b/drivers/mfd/88pm800.c @@ -121,7 +121,7 @@ static const struct i2c_device_id pm80x_id_table[] = { }; MODULE_DEVICE_TABLE(i2c, pm80x_id_table); -static struct resource rtc_resources[] = { +static const struct resource rtc_resources[] = { { .name = "88pm80x-rtc", .start = PM800_IRQ_RTC, diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c index c9bae71f643a..b1e829ea909b 100644 --- a/drivers/mfd/88pm860x-core.c +++ b/drivers/mfd/88pm860x-core.c @@ -26,99 +26,99 @@ #define INT_STATUS_NUM 3 -static struct resource bk0_resources[] = { +static const struct resource bk0_resources[] = { {2, 2, "duty cycle", IORESOURCE_REG, }, {3, 3, "always on", IORESOURCE_REG, }, {3, 3, "current", IORESOURCE_REG, }, }; -static struct resource bk1_resources[] = { +static const struct resource bk1_resources[] = { {4, 4, "duty cycle", IORESOURCE_REG, }, {5, 5, "always on", IORESOURCE_REG, }, {5, 5, "current", IORESOURCE_REG, }, }; -static struct resource bk2_resources[] = { +static const struct resource bk2_resources[] = { {6, 6, "duty cycle", IORESOURCE_REG, }, {7, 7, "always on", IORESOURCE_REG, }, {5, 5, "current", IORESOURCE_REG, }, }; -static struct resource led0_resources[] = { +static const struct resource led0_resources[] = { /* RGB1 Red LED */ {0xd, 0xd, "control", IORESOURCE_REG, }, {0xc, 0xc, "blink", IORESOURCE_REG, }, }; -static struct resource led1_resources[] = { +static const struct resource led1_resources[] = { /* RGB1 Green LED */ {0xe, 0xe, "control", IORESOURCE_REG, }, {0xc, 0xc, "blink", IORESOURCE_REG, }, }; -static struct resource led2_resources[] = { +static const struct resource led2_resources[] = { /* RGB1 Blue LED */ {0xf, 0xf, "control", IORESOURCE_REG, }, {0xc, 0xc, "blink", IORESOURCE_REG, }, }; -static struct resource led3_resources[] = { +static const struct resource led3_resources[] = { /* RGB2 Red LED */ {0x9, 0x9, "control", IORESOURCE_REG, }, {0x8, 0x8, "blink", IORESOURCE_REG, }, }; -static struct resource led4_resources[] = { +static const struct resource led4_resources[] = { /* RGB2 Green LED */ {0xa, 0xa, "control", IORESOURCE_REG, }, {0x8, 0x8, "blink", IORESOURCE_REG, }, }; -static struct resource led5_resources[] = { +static const struct resource led5_resources[] = { /* RGB2 Blue LED */ {0xb, 0xb, "control", IORESOURCE_REG, }, {0x8, 0x8, "blink", IORESOURCE_REG, }, }; -static struct resource buck1_resources[] = { +static const struct resource buck1_resources[] = { {0x24, 0x24, "buck set", IORESOURCE_REG, }, }; -static struct resource buck2_resources[] = { +static const struct resource buck2_resources[] = { {0x25, 0x25, "buck set", IORESOURCE_REG, }, }; -static struct resource buck3_resources[] = { +static const struct resource buck3_resources[] = { {0x26, 0x26, "buck set", IORESOURCE_REG, }, }; -static struct resource ldo1_resources[] = { +static const struct resource ldo1_resources[] = { {0x10, 0x10, "ldo set", IORESOURCE_REG, }, }; -static struct resource ldo2_resources[] = { +static const struct resource ldo2_resources[] = { {0x11, 0x11, "ldo set", IORESOURCE_REG, }, }; -static struct resource ldo3_resources[] = { +static const struct resource ldo3_resources[] = { {0x12, 0x12, "ldo set", IORESOURCE_REG, }, }; -static struct resource ldo4_resources[] = { +static const struct resource ldo4_resources[] = { {0x13, 0x13, "ldo set", IORESOURCE_REG, }, }; -static struct resource ldo5_resources[] = { +static const struct resource ldo5_resources[] = { {0x14, 0x14, "ldo set", IORESOURCE_REG, }, }; -static struct resource ldo6_resources[] = { +static const struct resource ldo6_resources[] = { {0x15, 0x15, "ldo set", IORESOURCE_REG, }, }; -static struct resource ldo7_resources[] = { +static const struct resource ldo7_resources[] = { {0x16, 0x16, "ldo set", IORESOURCE_REG, }, }; -static struct resource ldo8_resources[] = { +static const struct resource ldo8_resources[] = { {0x17, 0x17, "ldo set", IORESOURCE_REG, }, }; -static struct resource ldo9_resources[] = { +static const struct resource ldo9_resources[] = { {0x18, 0x18, "ldo set", IORESOURCE_REG, }, }; -static struct resource ldo10_resources[] = { +static const struct resource ldo10_resources[] = { {0x19, 0x19, "ldo set", IORESOURCE_REG, }, }; -static struct resource ldo12_resources[] = { +static const struct resource ldo12_resources[] = { {0x1a, 0x1a, "ldo set", IORESOURCE_REG, }, }; -static struct resource ldo_vibrator_resources[] = { +static const struct resource ldo_vibrator_resources[] = { {0x28, 0x28, "ldo set", IORESOURCE_REG, }, }; -static struct resource ldo14_resources[] = { +static const struct resource ldo14_resources[] = { {0x1b, 0x1b, "ldo set", IORESOURCE_REG, }, }; diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index cc0b73280c68..bdfce7b15621 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -730,33 +730,9 @@ config MFD_KEMPLD select MFD_CORE help This is the core driver for the PLD (Programmable Logic Device) found - on some Kontron ETX and COMexpress (ETXexpress) modules. The PLD - device may provide functions like watchdog, GPIO, UART and I2C bus. - - The following modules are supported: - * COMe-bBD# - * COMe-bBL6 - * COMe-bHL6 - * COMe-bSL6 - * COMe-bIP# - * COMe-bKL6 - * COMe-bPC2 (ETXexpress-PC) - * COMe-bSC# (ETXexpress-SC T#) - * COMe-cAL6 - * COMe-cBL6 - * COMe-cBT6 - * COMe-cBW6 - * COMe-cCT6 - * COMe-cDC2 (microETXexpress-DC) - * COMe-cHL6 - * COMe-cKL6 - * COMe-cPC2 (microETXexpress-PC) - * COMe-cSL6 - * COMe-mAL10 - * COMe-mBT10 - * COMe-mCT10 - * COMe-mTT10 (nanoETXexpress-TT) - * ETX-OH + on some Kontron ETX and nearly all COMexpress (ETXexpress) modules as + well as on some other Kontron products. The PLD device may provide + functions like watchdog, GPIO, UART and I2C bus. This driver can also be built as a module. If so, the module will be called kempld-core. @@ -1199,6 +1175,7 @@ config MFD_SIMPLE_MFD_I2C config MFD_SL28CPLD tristate "Kontron sl28cpld Board Management Controller" depends on I2C + depends on ARCH_LAYERSCAPE || COMPILE_TEST select MFD_SIMPLE_MFD_I2C help Say yes here to enable support for the Kontron sl28cpld board @@ -1442,6 +1419,7 @@ config MFD_TI_LMU config MFD_OMAP_USB_HOST bool "TI OMAP USBHS core and TLL driver" depends on USB_EHCI_HCD_OMAP || USB_OHCI_HCD_OMAP3 + depends on COMMON_CLK default y help This is the core driver for the OAMP EHCI and OHCI drivers. diff --git a/drivers/mfd/altera-sysmgr.c b/drivers/mfd/altera-sysmgr.c index 41076d121dd5..193a96c8b1ea 100644 --- a/drivers/mfd/altera-sysmgr.c +++ b/drivers/mfd/altera-sysmgr.c @@ -152,7 +152,7 @@ static int sysmgr_probe(struct platform_device *pdev) if (!base) return -ENOMEM; - sysmgr_config.max_register = res->end - res->start - 3; + sysmgr_config.max_register = resource_size(res) - 3; regmap = devm_regmap_init_mmio(dev, base, &sysmgr_config); } diff --git a/drivers/mfd/at91-usart.c b/drivers/mfd/at91-usart.c index 6a8351a4588e..7f08cb60c58b 100644 --- a/drivers/mfd/at91-usart.c +++ b/drivers/mfd/at91-usart.c @@ -15,15 +15,11 @@ #include <linux/of.h> #include <linux/property.h> -static const struct mfd_cell at91_usart_spi_subdev = { - .name = "at91_usart_spi", - .of_compatible = "microchip,at91sam9g45-usart-spi", -}; +static const struct mfd_cell at91_usart_spi_subdev = + MFD_CELL_NAME("at91_usart_spi"); -static const struct mfd_cell at91_usart_serial_subdev = { - .name = "atmel_usart_serial", - .of_compatible = "atmel,at91rm9200-usart-serial", -}; +static const struct mfd_cell at91_usart_serial_subdev = + MFD_CELL_NAME("atmel_usart_serial"); static int at91_usart_mode_probe(struct platform_device *pdev) { diff --git a/drivers/mfd/axp20x-i2c.c b/drivers/mfd/axp20x-i2c.c index 068e9c083f13..2cfde81f5fbf 100644 --- a/drivers/mfd/axp20x-i2c.c +++ b/drivers/mfd/axp20x-i2c.c @@ -57,6 +57,7 @@ static int axp20x_i2c_remove(struct i2c_client *i2c) return axp20x_device_remove(axp20x); } +#ifdef CONFIG_OF static const struct of_device_id axp20x_i2c_of_match[] = { { .compatible = "x-powers,axp152", .data = (void *)AXP152_ID }, { .compatible = "x-powers,axp202", .data = (void *)AXP202_ID }, @@ -68,6 +69,7 @@ static const struct of_device_id axp20x_i2c_of_match[] = { { }, }; MODULE_DEVICE_TABLE(of, axp20x_i2c_of_match); +#endif static const struct i2c_device_id axp20x_i2c_id[] = { { "axp152", 0 }, diff --git a/drivers/mfd/bcm590xx.c b/drivers/mfd/bcm590xx.c index bfac5dc091ca..6ca337cde84c 100644 --- a/drivers/mfd/bcm590xx.c +++ b/drivers/mfd/bcm590xx.c @@ -107,7 +107,7 @@ MODULE_DEVICE_TABLE(i2c, bcm590xx_i2c_id); static struct i2c_driver bcm590xx_i2c_driver = { .driver = { .name = "bcm590xx", - .of_match_table = of_match_ptr(bcm590xx_of_match), + .of_match_table = bcm590xx_of_match, }, .probe = bcm590xx_i2c_probe, .id_table = bcm590xx_i2c_id, diff --git a/drivers/mfd/da9055-core.c b/drivers/mfd/da9055-core.c index 6d0af8486269..d074d213e661 100644 --- a/drivers/mfd/da9055-core.c +++ b/drivers/mfd/da9055-core.c @@ -254,14 +254,14 @@ const struct regmap_config da9055_regmap_config = { }; EXPORT_SYMBOL_GPL(da9055_regmap_config); -static struct resource da9055_onkey_resource = { +static const struct resource da9055_onkey_resource = { .name = "ONKEY", .start = DA9055_IRQ_NONKEY, .end = DA9055_IRQ_NONKEY, .flags = IORESOURCE_IRQ, }; -static struct resource da9055_rtc_resource[] = { +static const struct resource da9055_rtc_resource[] = { { .name = "ALM", .start = DA9055_IRQ_ALARM, @@ -276,14 +276,14 @@ static struct resource da9055_rtc_resource[] = { }, }; -static struct resource da9055_hwmon_resource = { +static const struct resource da9055_hwmon_resource = { .name = "HWMON", .start = DA9055_IRQ_HWMON, .end = DA9055_IRQ_HWMON, .flags = IORESOURCE_IRQ, }; -static struct resource da9055_ld05_6_resource = { +static const struct resource da9055_ld05_6_resource = { .name = "REGULATOR", .start = DA9055_IRQ_REGULATOR, .end = DA9055_IRQ_REGULATOR, diff --git a/drivers/mfd/da9055-i2c.c b/drivers/mfd/da9055-i2c.c index 950b75ff6b04..bc60433b68db 100644 --- a/drivers/mfd/da9055-i2c.c +++ b/drivers/mfd/da9055-i2c.c @@ -74,7 +74,7 @@ static struct i2c_driver da9055_i2c_driver = { .id_table = da9055_i2c_id, .driver = { .name = "da9055-pmic", - .of_match_table = of_match_ptr(da9055_of_match), + .of_match_table = da9055_of_match, }, }; diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index fc30726e2e27..8d913375152d 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -160,23 +160,23 @@ static struct regmap_irq_chip da9062_irq_chip = { .ack_base = DA9062AA_EVENT_A, }; -static struct resource da9061_core_resources[] = { +static const struct resource da9061_core_resources[] = { DEFINE_RES_IRQ_NAMED(DA9061_IRQ_VDD_WARN, "VDD_WARN"), }; -static struct resource da9061_regulators_resources[] = { +static const struct resource da9061_regulators_resources[] = { DEFINE_RES_IRQ_NAMED(DA9061_IRQ_LDO_LIM, "LDO_LIM"), }; -static struct resource da9061_thermal_resources[] = { +static const struct resource da9061_thermal_resources[] = { DEFINE_RES_IRQ_NAMED(DA9061_IRQ_TEMP, "THERMAL"), }; -static struct resource da9061_wdt_resources[] = { +static const struct resource da9061_wdt_resources[] = { DEFINE_RES_IRQ_NAMED(DA9061_IRQ_WDG_WARN, "WD_WARN"), }; -static struct resource da9061_onkey_resources[] = { +static const struct resource da9061_onkey_resources[] = { DEFINE_RES_IRQ_NAMED(DA9061_IRQ_ONKEY, "ONKEY"), }; @@ -211,32 +211,32 @@ static const struct mfd_cell da9061_devs[] = { }, }; -static struct resource da9062_core_resources[] = { +static const struct resource da9062_core_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_VDD_WARN, 1, "VDD_WARN", IORESOURCE_IRQ), }; -static struct resource da9062_regulators_resources[] = { +static const struct resource da9062_regulators_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_LDO_LIM, 1, "LDO_LIM", IORESOURCE_IRQ), }; -static struct resource da9062_thermal_resources[] = { +static const struct resource da9062_thermal_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_TEMP, 1, "THERMAL", IORESOURCE_IRQ), }; -static struct resource da9062_wdt_resources[] = { +static const struct resource da9062_wdt_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_WDG_WARN, 1, "WD_WARN", IORESOURCE_IRQ), }; -static struct resource da9062_rtc_resources[] = { +static const struct resource da9062_rtc_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_ALARM, 1, "ALARM", IORESOURCE_IRQ), DEFINE_RES_NAMED(DA9062_IRQ_TICK, 1, "TICK", IORESOURCE_IRQ), }; -static struct resource da9062_onkey_resources[] = { +static const struct resource da9062_onkey_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_ONKEY, 1, "ONKEY", IORESOURCE_IRQ), }; -static struct resource da9062_gpio_resources[] = { +static const struct resource da9062_gpio_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_GPI0, 1, "GPI0", IORESOURCE_IRQ), DEFINE_RES_NAMED(DA9062_IRQ_GPI1, 1, "GPI1", IORESOURCE_IRQ), DEFINE_RES_NAMED(DA9062_IRQ_GPI2, 1, "GPI2", IORESOURCE_IRQ), @@ -736,7 +736,7 @@ MODULE_DEVICE_TABLE(i2c, da9062_i2c_id); static struct i2c_driver da9062_i2c_driver = { .driver = { .name = "da9062", - .of_match_table = of_match_ptr(da9062_dt_ids), + .of_match_table = da9062_dt_ids, }, .probe = da9062_i2c_probe, .remove = da9062_i2c_remove, diff --git a/drivers/mfd/da9063-core.c b/drivers/mfd/da9063-core.c index a353d52210a9..df407c3afce3 100644 --- a/drivers/mfd/da9063-core.c +++ b/drivers/mfd/da9063-core.c @@ -29,7 +29,7 @@ #include <linux/uaccess.h> -static struct resource da9063_regulators_resources[] = { +static const struct resource da9063_regulators_resources[] = { { .name = "LDO_LIM", .start = DA9063_IRQ_LDO_LIM, @@ -38,7 +38,7 @@ static struct resource da9063_regulators_resources[] = { }, }; -static struct resource da9063_rtc_resources[] = { +static const struct resource da9063_rtc_resources[] = { { .name = "ALARM", .start = DA9063_IRQ_ALARM, @@ -53,7 +53,7 @@ static struct resource da9063_rtc_resources[] = { } }; -static struct resource da9063_onkey_resources[] = { +static const struct resource da9063_onkey_resources[] = { { .name = "ONKEY", .start = DA9063_IRQ_ONKEY, @@ -62,7 +62,7 @@ static struct resource da9063_onkey_resources[] = { }, }; -static struct resource da9063_hwmon_resources[] = { +static const struct resource da9063_hwmon_resources[] = { { .start = DA9063_IRQ_ADC_RDY, .end = DA9063_IRQ_ADC_RDY, diff --git a/drivers/mfd/da9063-i2c.c b/drivers/mfd/da9063-i2c.c index b8217ad303ce..3781d0bb7786 100644 --- a/drivers/mfd/da9063-i2c.c +++ b/drivers/mfd/da9063-i2c.c @@ -455,7 +455,7 @@ MODULE_DEVICE_TABLE(i2c, da9063_i2c_id); static struct i2c_driver da9063_i2c_driver = { .driver = { .name = "da9063", - .of_match_table = of_match_ptr(da9063_dt_ids), + .of_match_table = da9063_dt_ids, }, .probe = da9063_i2c_probe, .id_table = da9063_i2c_id, diff --git a/drivers/mfd/da9150-core.c b/drivers/mfd/da9150-core.c index 7f0aa1e8db96..58009c8cb870 100644 --- a/drivers/mfd/da9150-core.c +++ b/drivers/mfd/da9150-core.c @@ -350,18 +350,18 @@ static const struct regmap_irq_chip da9150_regmap_irq_chip = { .num_irqs = ARRAY_SIZE(da9150_irqs), }; -static struct resource da9150_gpadc_resources[] = { +static const struct resource da9150_gpadc_resources[] = { DEFINE_RES_IRQ_NAMED(DA9150_IRQ_GPADC, "GPADC"), }; -static struct resource da9150_charger_resources[] = { +static const struct resource da9150_charger_resources[] = { DEFINE_RES_IRQ_NAMED(DA9150_IRQ_CHG, "CHG_STATUS"), DEFINE_RES_IRQ_NAMED(DA9150_IRQ_TJUNC, "CHG_TJUNC"), DEFINE_RES_IRQ_NAMED(DA9150_IRQ_VFAULT, "CHG_VFAULT"), DEFINE_RES_IRQ_NAMED(DA9150_IRQ_VBUS, "CHG_VBUS"), }; -static struct resource da9150_fg_resources[] = { +static const struct resource da9150_fg_resources[] = { DEFINE_RES_IRQ_NAMED(DA9150_IRQ_FG, "FG"), }; @@ -511,7 +511,7 @@ MODULE_DEVICE_TABLE(of, da9150_of_match); static struct i2c_driver da9150_driver = { .driver = { .name = "da9150", - .of_match_table = of_match_ptr(da9150_of_match), + .of_match_table = da9150_of_match, }, .probe = da9150_probe, .remove = da9150_remove, diff --git a/drivers/mfd/ene-kb3930.c b/drivers/mfd/ene-kb3930.c index 1c32ff586816..83243e668e3f 100644 --- a/drivers/mfd/ene-kb3930.c +++ b/drivers/mfd/ene-kb3930.c @@ -202,7 +202,7 @@ static struct i2c_driver kb3930_driver = { .remove = kb3930_remove, .driver = { .name = "ene-kb3930", - .of_match_table = of_match_ptr(kb3930_dt_ids), + .of_match_table = kb3930_dt_ids, }, }; module_i2c_driver(kb3930_driver); diff --git a/drivers/mfd/fsl-imx25-tsadc.c b/drivers/mfd/fsl-imx25-tsadc.c index a016b39fe9b0..5f6f0a83e1c5 100644 --- a/drivers/mfd/fsl-imx25-tsadc.c +++ b/drivers/mfd/fsl-imx25-tsadc.c @@ -196,7 +196,7 @@ MODULE_DEVICE_TABLE(of, mx25_tsadc_ids); static struct platform_driver mx25_tsadc_driver = { .driver = { .name = "mx25-tsadc", - .of_match_table = of_match_ptr(mx25_tsadc_ids), + .of_match_table = mx25_tsadc_ids, }, .probe = mx25_tsadc_probe, .remove = mx25_tsadc_remove, diff --git a/drivers/mfd/hi655x-pmic.c b/drivers/mfd/hi655x-pmic.c index 7e3959aaa285..d3c86a7a3805 100644 --- a/drivers/mfd/hi655x-pmic.c +++ b/drivers/mfd/hi655x-pmic.c @@ -49,7 +49,7 @@ static struct regmap_config hi655x_regmap_config = { .max_register = HI655X_BUS_ADDR(0x400) - HI655X_STRIDE, }; -static struct resource pwrkey_resources[] = { +static const struct resource pwrkey_resources[] = { { .name = "down", .start = PWRON_D20R_INT, diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c index 247f9849e54a..417b0355d904 100644 --- a/drivers/mfd/htc-i2cpld.c +++ b/drivers/mfd/htc-i2cpld.c @@ -346,6 +346,7 @@ static int htcpld_register_chip_i2c( if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE_DATA)) { dev_warn(dev, "i2c adapter %d non-functional\n", pdata->i2c_adapter_id); + i2c_put_adapter(adapter); return -EINVAL; } @@ -360,6 +361,7 @@ static int htcpld_register_chip_i2c( /* I2C device registration failed, contineu with the next */ dev_warn(dev, "Unable to add I2C device for 0x%x\n", plat_chip_data->addr); + i2c_put_adapter(adapter); return PTR_ERR(client); } diff --git a/drivers/mfd/intel_msic.c b/drivers/mfd/intel_msic.c index bb24c2a07900..daa772f8146b 100644 --- a/drivers/mfd/intel_msic.c +++ b/drivers/mfd/intel_msic.c @@ -50,23 +50,23 @@ struct intel_msic { void __iomem *irq_base; }; -static struct resource msic_touch_resources[] = { +static const struct resource msic_touch_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_adc_resources[] = { +static const struct resource msic_adc_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_battery_resources[] = { +static const struct resource msic_battery_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_gpio_resources[] = { +static const struct resource msic_gpio_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_audio_resources[] = { +static const struct resource msic_audio_resources[] = { DEFINE_RES_IRQ_NAMED(0, "IRQ"), /* * We will pass IRQ_BASE to the driver now but this can be removed @@ -75,19 +75,19 @@ static struct resource msic_audio_resources[] = { DEFINE_RES_MEM_NAMED(MSIC_IRQ_STATUS_ACCDET, 1, "IRQ_BASE"), }; -static struct resource msic_hdmi_resources[] = { +static const struct resource msic_hdmi_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_thermal_resources[] = { +static const struct resource msic_thermal_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_power_btn_resources[] = { +static const struct resource msic_power_btn_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_ocd_resources[] = { +static const struct resource msic_ocd_resources[] = { DEFINE_RES_IRQ(0), }; diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c index 84ca7902e1df..fe8ca945f367 100644 --- a/drivers/mfd/intel_quark_i2c_gpio.c +++ b/drivers/mfd/intel_quark_i2c_gpio.c @@ -72,7 +72,7 @@ static const struct dmi_system_id dmi_platform_info[] = { {} }; -static struct resource intel_quark_i2c_res[] = { +static const struct resource intel_quark_i2c_res[] = { [INTEL_QUARK_IORES_MEM] = { .flags = IORESOURCE_MEM, }, @@ -85,7 +85,7 @@ static struct mfd_cell_acpi_match intel_quark_acpi_match_i2c = { .adr = MFD_ACPI_MATCH_I2C, }; -static struct resource intel_quark_gpio_res[] = { +static const struct resource intel_quark_gpio_res[] = { [INTEL_QUARK_IORES_MEM] = { .flags = IORESOURCE_MEM, }, diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c index eba89780dbe7..47d0d3a69a58 100644 --- a/drivers/mfd/intel_soc_pmic_bxtwc.c +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c @@ -200,32 +200,32 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_crit = { .num_regs = 1, }; -static struct resource gpio_resources[] = { +static const struct resource gpio_resources[] = { DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"), }; -static struct resource adc_resources[] = { +static const struct resource adc_resources[] = { DEFINE_RES_IRQ_NAMED(BXTWC_ADC_IRQ, "ADC"), }; -static struct resource usbc_resources[] = { +static const struct resource usbc_resources[] = { DEFINE_RES_IRQ(BXTWC_USBC_IRQ), }; -static struct resource charger_resources[] = { +static const struct resource charger_resources[] = { DEFINE_RES_IRQ_NAMED(BXTWC_CHGR0_IRQ, "CHARGER"), DEFINE_RES_IRQ_NAMED(BXTWC_CHGR1_IRQ, "CHARGER1"), }; -static struct resource thermal_resources[] = { +static const struct resource thermal_resources[] = { DEFINE_RES_IRQ(BXTWC_THRM_LVL1_IRQ), }; -static struct resource bcu_resources[] = { +static const struct resource bcu_resources[] = { DEFINE_RES_IRQ_NAMED(BXTWC_BCU_IRQ, "BCU"), }; -static struct resource tmu_resources[] = { +static const struct resource tmu_resources[] = { DEFINE_RES_IRQ_NAMED(BXTWC_TMU_IRQ, "TMU"), }; diff --git a/drivers/mfd/intel_soc_pmic_chtdc_ti.c b/drivers/mfd/intel_soc_pmic_chtdc_ti.c index 64b5c3cc30e7..1c7577b881ff 100644 --- a/drivers/mfd/intel_soc_pmic_chtdc_ti.c +++ b/drivers/mfd/intel_soc_pmic_chtdc_ti.c @@ -32,23 +32,23 @@ enum { CHTDC_TI_CCEOCAL = 7, /* battery */ }; -static struct resource power_button_resources[] = { +static const struct resource power_button_resources[] = { DEFINE_RES_IRQ(CHTDC_TI_PWRBTN), }; -static struct resource thermal_resources[] = { +static const struct resource thermal_resources[] = { DEFINE_RES_IRQ(CHTDC_TI_DIETMPWARN), }; -static struct resource adc_resources[] = { +static const struct resource adc_resources[] = { DEFINE_RES_IRQ(CHTDC_TI_ADCCMPL), }; -static struct resource pwrsrc_resources[] = { +static const struct resource pwrsrc_resources[] = { DEFINE_RES_IRQ(CHTDC_TI_VBUSDET), }; -static struct resource battery_resources[] = { +static const struct resource battery_resources[] = { DEFINE_RES_IRQ(CHTDC_TI_VBATLOW), DEFINE_RES_IRQ(CHTDC_TI_CCEOCAL), }; diff --git a/drivers/mfd/intel_soc_pmic_chtwc.c b/drivers/mfd/intel_soc_pmic_chtwc.c index be84bb2aa837..49c5f71664bc 100644 --- a/drivers/mfd/intel_soc_pmic_chtwc.c +++ b/drivers/mfd/intel_soc_pmic_chtwc.c @@ -41,11 +41,11 @@ enum { CHT_WC_CRIT_IRQ = 7, }; -static struct resource cht_wc_pwrsrc_resources[] = { +static const struct resource cht_wc_pwrsrc_resources[] = { DEFINE_RES_IRQ(CHT_WC_PWRSRC_IRQ), }; -static struct resource cht_wc_ext_charger_resources[] = { +static const struct resource cht_wc_ext_charger_resources[] = { DEFINE_RES_IRQ(CHT_WC_EXT_CHGR_IRQ), }; diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c index 429efa1f8e55..38acb20e2d60 100644 --- a/drivers/mfd/intel_soc_pmic_crc.c +++ b/drivers/mfd/intel_soc_pmic_crc.c @@ -28,23 +28,23 @@ #define CRYSTAL_COVE_IRQ_GPIO 5 #define CRYSTAL_COVE_IRQ_VHDMIOCP 6 -static struct resource gpio_resources[] = { +static const struct resource gpio_resources[] = { DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_GPIO, "GPIO"), }; -static struct resource pwrsrc_resources[] = { +static const struct resource pwrsrc_resources[] = { DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_PWRSRC, "PWRSRC"), }; -static struct resource adc_resources[] = { +static const struct resource adc_resources[] = { DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_ADC, "ADC"), }; -static struct resource thermal_resources[] = { +static const struct resource thermal_resources[] = { DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_THRM, "THERMAL"), }; -static struct resource bcu_resources[] = { +static const struct resource bcu_resources[] = { DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_BCU, "BCU"), }; diff --git a/drivers/mfd/ioc3.c b/drivers/mfd/ioc3.c index d939ccc46509..c73ec78f255b 100644 --- a/drivers/mfd/ioc3.c +++ b/drivers/mfd/ioc3.c @@ -158,13 +158,13 @@ err: return -ENOMEM; } -static struct resource ioc3_uarta_resources[] = { +static const struct resource ioc3_uarta_resources[] = { DEFINE_RES_MEM(offsetof(struct ioc3, sregs.uarta), sizeof_field(struct ioc3, sregs.uarta)), DEFINE_RES_IRQ(IOC3_IRQ_SERIAL_A) }; -static struct resource ioc3_uartb_resources[] = { +static const struct resource ioc3_uartb_resources[] = { DEFINE_RES_MEM(offsetof(struct ioc3, sregs.uartb), sizeof_field(struct ioc3, sregs.uartb)), DEFINE_RES_IRQ(IOC3_IRQ_SERIAL_B) @@ -213,7 +213,7 @@ static int ioc3_serial_setup(struct ioc3_priv_data *ipd) return 0; } -static struct resource ioc3_kbd_resources[] = { +static const struct resource ioc3_kbd_resources[] = { DEFINE_RES_MEM(offsetof(struct ioc3, serio), sizeof_field(struct ioc3, serio)), DEFINE_RES_IRQ(IOC3_IRQ_KBD) @@ -242,7 +242,7 @@ static int ioc3_kbd_setup(struct ioc3_priv_data *ipd) return 0; } -static struct resource ioc3_eth_resources[] = { +static const struct resource ioc3_eth_resources[] = { DEFINE_RES_MEM(offsetof(struct ioc3, eth), sizeof_field(struct ioc3, eth)), DEFINE_RES_MEM(offsetof(struct ioc3, ssram), @@ -250,7 +250,7 @@ static struct resource ioc3_eth_resources[] = { DEFINE_RES_IRQ(0) }; -static struct resource ioc3_w1_resources[] = { +static const struct resource ioc3_w1_resources[] = { DEFINE_RES_MEM(offsetof(struct ioc3, mcr), sizeof_field(struct ioc3, mcr)), }; @@ -294,7 +294,7 @@ static int ioc3_eth_setup(struct ioc3_priv_data *ipd) return 0; } -static struct resource ioc3_m48t35_resources[] = { +static const struct resource ioc3_m48t35_resources[] = { DEFINE_RES_MEM(IOC3_BYTEBUS_DEV0, M48T35_REG_SIZE) }; @@ -326,7 +326,7 @@ static struct ds1685_rtc_platform_data ip30_rtc_platform_data = { .access_type = ds1685_reg_indirect, }; -static struct resource ioc3_rtc_ds1685_resources[] = { +static const struct resource ioc3_rtc_ds1685_resources[] = { DEFINE_RES_MEM(IOC3_BYTEBUS_DEV1, 1), DEFINE_RES_MEM(IOC3_BYTEBUS_DEV2, 1), DEFINE_RES_IRQ(0) @@ -359,7 +359,7 @@ static int ioc3_ds1685_setup(struct ioc3_priv_data *ipd) }; -static struct resource ioc3_leds_resources[] = { +static const struct resource ioc3_leds_resources[] = { DEFINE_RES_MEM(offsetof(struct ioc3, gppr[0]), sizeof_field(struct ioc3, gppr[0])), DEFINE_RES_MEM(offsetof(struct ioc3, gppr[1]), diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c index 2c9295953c11..9166075c1f32 100644 --- a/drivers/mfd/kempld-core.c +++ b/drivers/mfd/kempld-core.c @@ -125,7 +125,6 @@ static const struct kempld_platform_data kempld_platform_data_generic = { }; static struct platform_device *kempld_pdev; -static bool kempld_acpi_mode; static int kempld_create_platform_device(const struct dmi_system_id *id) { @@ -501,8 +500,6 @@ static int kempld_probe(struct platform_device *pdev) ret = kempld_get_acpi_data(pdev); if (ret) return ret; - - kempld_acpi_mode = true; } else if (kempld_pdev != pdev) { /* * The platform device we are probing is not the one we @@ -555,6 +552,7 @@ static int kempld_remove(struct platform_device *pdev) #ifdef CONFIG_ACPI static const struct acpi_device_id kempld_acpi_table[] = { + { "KEM0000", (kernel_ulong_t)&kempld_platform_data_generic }, { "KEM0001", (kernel_ulong_t)&kempld_platform_data_generic }, {} }; @@ -565,7 +563,6 @@ static struct platform_driver kempld_driver = { .driver = { .name = "kempld", .acpi_match_table = ACPI_PTR(kempld_acpi_table), - .probe_type = PROBE_FORCE_SYNCHRONOUS, }, .probe = kempld_probe, .remove = kempld_remove, @@ -589,6 +586,14 @@ static const struct dmi_system_id kempld_dmi_table[] __initconst = { .driver_data = (void *)&kempld_platform_data_generic, .callback = kempld_create_platform_device, }, { + .ident = "BDV7", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), + DMI_MATCH(DMI_BOARD_NAME, "COMe-bDV7"), + }, + .driver_data = (void *)&kempld_platform_data_generic, + .callback = kempld_create_platform_device, + }, { .ident = "BHL6", .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), @@ -653,6 +658,14 @@ static const struct dmi_system_id kempld_dmi_table[] __initconst = { .driver_data = (void *)&kempld_platform_data_generic, .callback = kempld_create_platform_device, }, { + .ident = "CDV7", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), + DMI_MATCH(DMI_BOARD_NAME, "COMe-cDV7"), + }, + .driver_data = (void *)&kempld_platform_data_generic, + .callback = kempld_create_platform_device, + }, { .ident = "CHL6", .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), @@ -772,6 +785,22 @@ static const struct dmi_system_id kempld_dmi_table[] __initconst = { .driver_data = (void *)&kempld_platform_data_generic, .callback = kempld_create_platform_device, }, { + .ident = "A203", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), + DMI_MATCH(DMI_BOARD_NAME, "KBox A-203"), + }, + .driver_data = (void *)&kempld_platform_data_generic, + .callback = kempld_create_platform_device, + }, { + .ident = "M4A1", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), + DMI_MATCH(DMI_BOARD_NAME, "COMe-m4AL"), + }, + .driver_data = (void *)&kempld_platform_data_generic, + .callback = kempld_create_platform_device, + }, { .ident = "MAL1", .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), @@ -780,6 +809,14 @@ static const struct dmi_system_id kempld_dmi_table[] __initconst = { .driver_data = (void *)&kempld_platform_data_generic, .callback = kempld_create_platform_device, }, { + .ident = "MAPL", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), + DMI_MATCH(DMI_BOARD_NAME, "mITX-APL"), + }, + .driver_data = (void *)&kempld_platform_data_generic, + .callback = kempld_create_platform_device, + }, { .ident = "MBR1", .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), @@ -828,6 +865,30 @@ static const struct dmi_system_id kempld_dmi_table[] __initconst = { .driver_data = (void *)&kempld_platform_data_generic, .callback = kempld_create_platform_device, }, { + .ident = "PAPL", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), + DMI_MATCH(DMI_BOARD_NAME, "pITX-APL"), + }, + .driver_data = (void *)&kempld_platform_data_generic, + .callback = kempld_create_platform_device, + }, { + .ident = "SXAL", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), + DMI_MATCH(DMI_BOARD_NAME, "SMARC-sXAL"), + }, + .driver_data = (void *)&kempld_platform_data_generic, + .callback = kempld_create_platform_device, + }, { + .ident = "SXAL4", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), + DMI_MATCH(DMI_BOARD_NAME, "SMARC-sXA4"), + }, + .driver_data = (void *)&kempld_platform_data_generic, + .callback = kempld_create_platform_device, + }, { .ident = "UNP1", .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), @@ -867,8 +928,7 @@ static const struct dmi_system_id kempld_dmi_table[] __initconst = { }, .driver_data = (void *)&kempld_platform_data_generic, .callback = kempld_create_platform_device, - }, - { + }, { .ident = "UTH6", .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), @@ -876,6 +936,14 @@ static const struct dmi_system_id kempld_dmi_table[] __initconst = { }, .driver_data = (void *)&kempld_platform_data_generic, .callback = kempld_create_platform_device, + }, { + .ident = "Q7AL", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), + DMI_MATCH(DMI_BOARD_NAME, "Qseven-Q7AL"), + }, + .driver_data = (void *)&kempld_platform_data_generic, + .callback = kempld_create_platform_device, }, {} }; @@ -884,7 +952,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table); static int __init kempld_init(void) { const struct dmi_system_id *id; - int ret; if (force_device_id[0]) { for (id = kempld_dmi_table; @@ -894,24 +961,11 @@ static int __init kempld_init(void) break; if (id->matches[0].slot == DMI_NONE) return -ENODEV; - } - - ret = platform_driver_register(&kempld_driver); - if (ret) - return ret; - - /* - * With synchronous probing the device should already be probed now. - * If no device id is forced and also no ACPI definition for the - * device was found, scan DMI table as fallback. - * - * If drivers_autoprobing is disabled and the device is found here, - * only that device can be bound manually later. - */ - if (!kempld_pdev && !kempld_acpi_mode) + } else { dmi_check_system(kempld_dmi_table); + } - return 0; + return platform_driver_register(&kempld_driver); } static void __exit kempld_exit(void) diff --git a/drivers/mfd/lp8788.c b/drivers/mfd/lp8788.c index 768d556b3fe9..c223d2c6a363 100644 --- a/drivers/mfd/lp8788.c +++ b/drivers/mfd/lp8788.c @@ -34,7 +34,7 @@ .num_resources = num_resource, \ } -static struct resource chg_irqs[] = { +static const struct resource chg_irqs[] = { /* Charger Interrupts */ { .start = LP8788_INT_CHG_INPUT_STATE, @@ -58,7 +58,7 @@ static struct resource chg_irqs[] = { }, }; -static struct resource rtc_irqs[] = { +static const struct resource rtc_irqs[] = { { .start = LP8788_INT_RTC_ALARM1, .end = LP8788_INT_RTC_ALARM2, diff --git a/drivers/mfd/madera-core.c b/drivers/mfd/madera-core.c index 4ed6ad8ce002..a2abc0094def 100644 --- a/drivers/mfd/madera-core.c +++ b/drivers/mfd/madera-core.c @@ -38,6 +38,9 @@ #define MADERA_RESET_MIN_US 2000 #define MADERA_RESET_MAX_US 3000 +#define ERRATA_DCVDD_MIN_US 10000 +#define ERRATA_DCVDD_MAX_US 15000 + static const char * const madera_core_supplies[] = { "AVDD", "DBVDD1", @@ -291,6 +294,9 @@ static int __maybe_unused madera_runtime_resume(struct device *dev) dev_dbg(dev, "Leaving sleep mode\n"); + if (!madera->reset_errata) + madera_enable_hard_reset(madera); + ret = regulator_enable(madera->dcvdd); if (ret) { dev_err(dev, "Failed to enable DCVDD: %d\n", ret); @@ -300,7 +306,22 @@ static int __maybe_unused madera_runtime_resume(struct device *dev) regcache_cache_only(madera->regmap, false); regcache_cache_only(madera->regmap_32bit, false); - usleep_range(MADERA_RESET_MIN_US, MADERA_RESET_MAX_US); + if (madera->reset_errata) + usleep_range(ERRATA_DCVDD_MIN_US, ERRATA_DCVDD_MAX_US); + else + madera_disable_hard_reset(madera); + + if (!madera->pdata.reset || madera->reset_errata) { + ret = madera_wait_for_boot(madera); + if (ret) + goto err; + + ret = madera_soft_reset(madera); + if (ret) { + dev_err(dev, "Failed to reset: %d\n", ret); + goto err; + } + } ret = madera_wait_for_boot(madera); if (ret) @@ -489,6 +510,8 @@ int madera_dev_init(struct madera *madera) */ switch (madera->type) { case CS47L15: + madera->reset_errata = true; + break; case CS47L35: case CS47L90: case CS47L91: @@ -539,13 +562,19 @@ int madera_dev_init(struct madera *madera) goto err_dcvdd; } + if (madera->reset_errata) + madera_disable_hard_reset(madera); + ret = regulator_enable(madera->dcvdd); if (ret) { dev_err(dev, "Failed to enable DCVDD: %d\n", ret); goto err_enable; } - madera_disable_hard_reset(madera); + if (madera->reset_errata) + usleep_range(ERRATA_DCVDD_MIN_US, ERRATA_DCVDD_MAX_US); + else + madera_disable_hard_reset(madera); regcache_cache_only(madera->regmap, false); regcache_cache_only(madera->regmap_32bit, false); @@ -653,7 +682,7 @@ int madera_dev_init(struct madera *madera) * It looks like a device we support. If we don't have a hard reset * we can now attempt a soft reset. */ - if (!madera->pdata.reset) { + if (!madera->pdata.reset || madera->reset_errata) { ret = madera_soft_reset(madera); if (ret) goto err_reset; diff --git a/drivers/mfd/max77650.c b/drivers/mfd/max77650.c index 60e07aca6ae5..777485a33bc0 100644 --- a/drivers/mfd/max77650.c +++ b/drivers/mfd/max77650.c @@ -221,7 +221,7 @@ MODULE_DEVICE_TABLE(of, max77650_of_match); static struct i2c_driver max77650_i2c_driver = { .driver = { .name = "max77650", - .of_match_table = of_match_ptr(max77650_of_match), + .of_match_table = max77650_of_match, }, .probe_new = max77650_i2c_probe, }; diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c index 71faf503844b..2ad554b921d9 100644 --- a/drivers/mfd/max77686.c +++ b/drivers/mfd/max77686.c @@ -270,7 +270,7 @@ static struct i2c_driver max77686_i2c_driver = { .driver = { .name = "max77686", .pm = &max77686_pm, - .of_match_table = of_match_ptr(max77686_pmic_dt_match), + .of_match_table = max77686_pmic_dt_match, }, .probe_new = max77686_i2c_probe, }; diff --git a/drivers/mfd/max8925-core.c b/drivers/mfd/max8925-core.c index 0af6833b4080..eb3f061c8ee6 100644 --- a/drivers/mfd/max8925-core.c +++ b/drivers/mfd/max8925-core.c @@ -19,7 +19,7 @@ #include <linux/of.h> #include <linux/of_platform.h> -static struct resource bk_resources[] = { +static const struct resource bk_resources[] = { { 0x84, 0x84, "mode control", IORESOURCE_REG, }, { 0x85, 0x85, "control", IORESOURCE_REG, }, }; @@ -33,7 +33,7 @@ static struct mfd_cell bk_devs[] = { }, }; -static struct resource touch_resources[] = { +static const struct resource touch_resources[] = { { .name = "max8925-tsc", .start = MAX8925_TSC_IRQ, @@ -51,7 +51,7 @@ static const struct mfd_cell touch_devs[] = { }, }; -static struct resource power_supply_resources[] = { +static const struct resource power_supply_resources[] = { { .name = "max8925-power", .start = MAX8925_CHG_IRQ1, @@ -69,7 +69,7 @@ static const struct mfd_cell power_devs[] = { }, }; -static struct resource rtc_resources[] = { +static const struct resource rtc_resources[] = { { .name = "max8925-rtc", .start = MAX8925_IRQ_RTC_ALARM0, @@ -87,7 +87,7 @@ static const struct mfd_cell rtc_devs[] = { }, }; -static struct resource onkey_resources[] = { +static const struct resource onkey_resources[] = { { .name = "max8925-onkey", .start = MAX8925_IRQ_GPM_SW_R, @@ -110,95 +110,95 @@ static const struct mfd_cell onkey_devs[] = { }, }; -static struct resource sd1_resources[] = { +static const struct resource sd1_resources[] = { {0x06, 0x06, "sdv", IORESOURCE_REG, }, }; -static struct resource sd2_resources[] = { +static const struct resource sd2_resources[] = { {0x09, 0x09, "sdv", IORESOURCE_REG, }, }; -static struct resource sd3_resources[] = { +static const struct resource sd3_resources[] = { {0x0c, 0x0c, "sdv", IORESOURCE_REG, }, }; -static struct resource ldo1_resources[] = { +static const struct resource ldo1_resources[] = { {0x1a, 0x1a, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo2_resources[] = { +static const struct resource ldo2_resources[] = { {0x1e, 0x1e, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo3_resources[] = { +static const struct resource ldo3_resources[] = { {0x22, 0x22, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo4_resources[] = { +static const struct resource ldo4_resources[] = { {0x26, 0x26, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo5_resources[] = { +static const struct resource ldo5_resources[] = { {0x2a, 0x2a, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo6_resources[] = { +static const struct resource ldo6_resources[] = { {0x2e, 0x2e, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo7_resources[] = { +static const struct resource ldo7_resources[] = { {0x32, 0x32, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo8_resources[] = { +static const struct resource ldo8_resources[] = { {0x36, 0x36, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo9_resources[] = { +static const struct resource ldo9_resources[] = { {0x3a, 0x3a, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo10_resources[] = { +static const struct resource ldo10_resources[] = { {0x3e, 0x3e, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo11_resources[] = { +static const struct resource ldo11_resources[] = { {0x42, 0x42, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo12_resources[] = { +static const struct resource ldo12_resources[] = { {0x46, 0x46, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo13_resources[] = { +static const struct resource ldo13_resources[] = { {0x4a, 0x4a, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo14_resources[] = { +static const struct resource ldo14_resources[] = { {0x4e, 0x4e, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo15_resources[] = { +static const struct resource ldo15_resources[] = { {0x52, 0x52, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo16_resources[] = { +static const struct resource ldo16_resources[] = { {0x12, 0x12, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo17_resources[] = { +static const struct resource ldo17_resources[] = { {0x16, 0x16, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo18_resources[] = { +static const struct resource ldo18_resources[] = { {0x74, 0x74, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo19_resources[] = { +static const struct resource ldo19_resources[] = { {0x5e, 0x5e, "ldov", IORESOURCE_REG, }, }; -static struct resource ldo20_resources[] = { +static const struct resource ldo20_resources[] = { {0x9e, 0x9e, "ldov", IORESOURCE_REG, }, }; diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c index 2283d88adcc2..30d82bfe5b02 100644 --- a/drivers/mfd/motorola-cpcap.c +++ b/drivers/mfd/motorola-cpcap.c @@ -97,7 +97,7 @@ static struct regmap_irq_chip cpcap_irq_chip[CPCAP_NR_IRQ_CHIPS] = { .ack_base = CPCAP_REG_MI1, .mask_base = CPCAP_REG_MIM1, .use_ack = true, - .ack_invert = true, + .clear_ack = true, }, { .name = "cpcap-m2", @@ -106,7 +106,7 @@ static struct regmap_irq_chip cpcap_irq_chip[CPCAP_NR_IRQ_CHIPS] = { .ack_base = CPCAP_REG_MI2, .mask_base = CPCAP_REG_MIM2, .use_ack = true, - .ack_invert = true, + .clear_ack = true, }, { .name = "cpcap1-4", @@ -115,7 +115,7 @@ static struct regmap_irq_chip cpcap_irq_chip[CPCAP_NR_IRQ_CHIPS] = { .ack_base = CPCAP_REG_INT1, .mask_base = CPCAP_REG_INTM1, .use_ack = true, - .ack_invert = true, + .clear_ack = true, }, }; diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index f6cd8a660602..7518d74c3b4c 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -237,7 +237,7 @@ static struct platform_driver mt6397_driver = { .probe = mt6397_probe, .driver = { .name = "mt6397", - .of_match_table = of_match_ptr(mt6397_of_match), + .of_match_table = mt6397_of_match, }, .id_table = mt6397_id, }; diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c index 1df1a2711328..a35d5cf16faa 100644 --- a/drivers/mfd/qcom-spmi-pmic.c +++ b/drivers/mfd/qcom-spmi-pmic.c @@ -36,6 +36,8 @@ #define PM8998_SUBTYPE 0x14 #define PMI8998_SUBTYPE 0x15 #define PM8005_SUBTYPE 0x18 +#define PM660L_SUBTYPE 0x1A +#define PM660_SUBTYPE 0x1B static const struct of_device_id pmic_spmi_id_table[] = { { .compatible = "qcom,spmi-pmic", .data = (void *)COMMON_SUBTYPE }, @@ -57,6 +59,8 @@ static const struct of_device_id pmic_spmi_id_table[] = { { .compatible = "qcom,pm8998", .data = (void *)PM8998_SUBTYPE }, { .compatible = "qcom,pmi8998", .data = (void *)PMI8998_SUBTYPE }, { .compatible = "qcom,pm8005", .data = (void *)PM8005_SUBTYPE }, + { .compatible = "qcom,pm660l", .data = (void *)PM660L_SUBTYPE }, + { .compatible = "qcom,pm660", .data = (void *)PM660_SUBTYPE }, { } }; diff --git a/drivers/mfd/rdc321x-southbridge.c b/drivers/mfd/rdc321x-southbridge.c index fbb1faf95e27..c44a76285147 100644 --- a/drivers/mfd/rdc321x-southbridge.c +++ b/drivers/mfd/rdc321x-southbridge.c @@ -14,7 +14,7 @@ static struct rdc321x_wdt_pdata rdc321x_wdt_pdata; -static struct resource rdc321x_wdt_resource[] = { +static const struct resource rdc321x_wdt_resource[] = { { .name = "wdt-reg", .start = RDC321X_WDT_CTRL, @@ -27,7 +27,7 @@ static struct rdc321x_gpio_pdata rdc321x_gpio_pdata = { .max_gpios = RDC321X_NUM_GPIO, }; -static struct resource rdc321x_gpio_resources[] = { +static const struct resource rdc321x_gpio_resources[] = { { .name = "gpio-reg1", .start = RDC321X_GPIO_CTRL_REG1, diff --git a/drivers/mfd/retu-mfd.c b/drivers/mfd/retu-mfd.c index e7d27b7861c1..c748fd29a220 100644 --- a/drivers/mfd/retu-mfd.c +++ b/drivers/mfd/retu-mfd.c @@ -45,7 +45,7 @@ struct retu_dev { struct regmap_irq_chip_data *irq_data; }; -static struct resource retu_pwrbutton_res[] = { +static const struct resource retu_pwrbutton_res[] = { { .name = "retu-pwrbutton", .start = RETU_INT_PWR, @@ -84,7 +84,7 @@ static struct regmap_irq_chip retu_irq_chip = { /* Retu device registered for the power off. */ static struct retu_dev *retu_pm_power_off; -static struct resource tahvo_usb_res[] = { +static const struct resource tahvo_usb_res[] = { { .name = "tahvo-usb", .start = TAHVO_INT_VBUS, diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c index d109b9f14407..ad923dd4e007 100644 --- a/drivers/mfd/rk808.c +++ b/drivers/mfd/rk808.c @@ -107,20 +107,20 @@ static const struct regmap_config rk817_regmap_config = { .volatile_reg = rk817_is_volatile_reg, }; -static struct resource rtc_resources[] = { +static const struct resource rtc_resources[] = { DEFINE_RES_IRQ(RK808_IRQ_RTC_ALARM), }; -static struct resource rk817_rtc_resources[] = { +static const struct resource rk817_rtc_resources[] = { DEFINE_RES_IRQ(RK817_IRQ_RTC_ALARM), }; -static struct resource rk805_key_resources[] = { +static const struct resource rk805_key_resources[] = { DEFINE_RES_IRQ(RK805_IRQ_PWRON_RISE), DEFINE_RES_IRQ(RK805_IRQ_PWRON_FALL), }; -static struct resource rk817_pwrkey_resources[] = { +static const struct resource rk817_pwrkey_resources[] = { DEFINE_RES_IRQ(RK817_IRQ_PWRON_RISE), DEFINE_RES_IRQ(RK817_IRQ_PWRON_FALL), }; diff --git a/drivers/mfd/rt5033.c b/drivers/mfd/rt5033.c index 48381d9bf740..f1236a9acf30 100644 --- a/drivers/mfd/rt5033.c +++ b/drivers/mfd/rt5033.c @@ -122,7 +122,7 @@ MODULE_DEVICE_TABLE(of, rt5033_dt_match); static struct i2c_driver rt5033_driver = { .driver = { .name = "rt5033", - .of_match_table = of_match_ptr(rt5033_dt_match), + .of_match_table = rt5033_dt_match, }, .probe = rt5033_i2c_probe, .id_table = rt5033_i2c_id, diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c index 5e680bfdf5c9..e095a3930142 100644 --- a/drivers/mfd/stmfx.c +++ b/drivers/mfd/stmfx.c @@ -329,11 +329,11 @@ static int stmfx_chip_init(struct i2c_client *client) stmfx->vdd = devm_regulator_get_optional(&client->dev, "vdd"); ret = PTR_ERR_OR_ZERO(stmfx->vdd); - if (ret == -ENODEV) { - stmfx->vdd = NULL; - } else { - return dev_err_probe(&client->dev, ret, - "Failed to get VDD regulator\n"); + if (ret) { + if (ret == -ENODEV) + stmfx->vdd = NULL; + else + return dev_err_probe(&client->dev, ret, "Failed to get VDD regulator\n"); } if (stmfx->vdd) { @@ -548,7 +548,7 @@ MODULE_DEVICE_TABLE(of, stmfx_of_match); static struct i2c_driver stmfx_driver = { .driver = { .name = "stmfx-core", - .of_match_table = of_match_ptr(stmfx_of_match), + .of_match_table = stmfx_of_match, .pm = &stmfx_dev_pm_ops, }, .probe = stmfx_probe, diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c index 1aee3b3253fc..90f3292230c9 100644 --- a/drivers/mfd/stmpe.c +++ b/drivers/mfd/stmpe.c @@ -312,7 +312,7 @@ EXPORT_SYMBOL_GPL(stmpe_set_altfunc); * GPIO (all variants) */ -static struct resource stmpe_gpio_resources[] = { +static const struct resource stmpe_gpio_resources[] = { /* Start and end filled dynamically */ { .flags = IORESOURCE_IRQ, @@ -336,7 +336,7 @@ static const struct mfd_cell stmpe_gpio_cell_noirq = { * Keypad (1601, 2401, 2403) */ -static struct resource stmpe_keypad_resources[] = { +static const struct resource stmpe_keypad_resources[] = { { .name = "KEYPAD", .flags = IORESOURCE_IRQ, @@ -357,7 +357,7 @@ static const struct mfd_cell stmpe_keypad_cell = { /* * PWM (1601, 2401, 2403) */ -static struct resource stmpe_pwm_resources[] = { +static const struct resource stmpe_pwm_resources[] = { { .name = "PWM0", .flags = IORESOURCE_IRQ, @@ -445,7 +445,7 @@ static struct stmpe_variant_info stmpe801_noirq = { * Touchscreen (STMPE811 or STMPE610) */ -static struct resource stmpe_ts_resources[] = { +static const struct resource stmpe_ts_resources[] = { { .name = "TOUCH_DET", .flags = IORESOURCE_IRQ, @@ -467,7 +467,7 @@ static const struct mfd_cell stmpe_ts_cell = { * ADC (STMPE811) */ -static struct resource stmpe_adc_resources[] = { +static const struct resource stmpe_adc_resources[] = { { .name = "STMPE_TEMP_SENS", .flags = IORESOURCE_IRQ, diff --git a/drivers/mfd/sun4i-gpadc.c b/drivers/mfd/sun4i-gpadc.c index b346fbce3c01..cfe14d9bf6dc 100644 --- a/drivers/mfd/sun4i-gpadc.c +++ b/drivers/mfd/sun4i-gpadc.c @@ -18,7 +18,7 @@ #define ARCH_SUN5I_A13 1 #define ARCH_SUN6I_A31 2 -static struct resource adc_resources[] = { +static const struct resource adc_resources[] = { DEFINE_RES_IRQ_NAMED(SUN4I_GPADC_IRQ_FIFO_DATA, "FIFO_DATA_PENDING"), DEFINE_RES_IRQ_NAMED(SUN4I_GPADC_IRQ_TEMP_DATA, "TEMP_DATA_PENDING"), }; @@ -166,7 +166,7 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) static struct platform_driver sun4i_gpadc_driver = { .driver = { .name = "sun4i-gpadc", - .of_match_table = of_match_ptr(sun4i_gpadc_of_match), + .of_match_table = sun4i_gpadc_of_match, }, .probe = sun4i_gpadc_probe, }; diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c index ca465794ea9c..c6f139b2e0c0 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c @@ -255,6 +255,24 @@ struct regmap *syscon_regmap_lookup_by_phandle_args(struct device_node *np, } EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_phandle_args); +/* + * It behaves the same as syscon_regmap_lookup_by_phandle() except where + * there is no regmap phandle. In this case, instead of returning -ENODEV, + * the function returns NULL. + */ +struct regmap *syscon_regmap_lookup_by_phandle_optional(struct device_node *np, + const char *property) +{ + struct regmap *regmap; + + regmap = syscon_regmap_lookup_by_phandle(np, property); + if (IS_ERR(regmap) && PTR_ERR(regmap) == -ENODEV) + return NULL; + + return regmap; +} +EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_phandle_optional); + static int syscon_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c index 7882a37ffc35..7614f8fe0e91 100644 --- a/drivers/mfd/tc3589x.c +++ b/drivers/mfd/tc3589x.c @@ -141,7 +141,7 @@ out: } EXPORT_SYMBOL_GPL(tc3589x_set_bits); -static struct resource gpio_resources[] = { +static const struct resource gpio_resources[] = { { .start = TC3589x_INT_GPIIRQ, .end = TC3589x_INT_GPIIRQ, @@ -149,7 +149,7 @@ static struct resource gpio_resources[] = { }, }; -static struct resource keypad_resources[] = { +static const struct resource keypad_resources[] = { { .start = TC3589x_INT_KBDIRQ, .end = TC3589x_INT_KBDIRQ, diff --git a/drivers/mfd/tc6387xb.c b/drivers/mfd/tc6387xb.c index c66a701ab21c..e846e4d26b6e 100644 --- a/drivers/mfd/tc6387xb.c +++ b/drivers/mfd/tc6387xb.c @@ -25,7 +25,7 @@ struct tc6387xb { struct resource rscr; }; -static struct resource tc6387xb_mmc_resources[] = { +static const struct resource tc6387xb_mmc_resources[] = { { .start = 0x800, .end = 0x9ff, diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c index 05d5059ca203..3d5b14c60e20 100644 --- a/drivers/mfd/tc6393xb.c +++ b/drivers/mfd/tc6393xb.c @@ -133,7 +133,7 @@ static int tc6393xb_nand_enable(struct platform_device *nand) return 0; } -static struct resource tc6393xb_nand_resources[] = { +static const struct resource tc6393xb_nand_resources[] = { { .start = 0x1000, .end = 0x1007, @@ -151,7 +151,7 @@ static struct resource tc6393xb_nand_resources[] = { }, }; -static struct resource tc6393xb_mmc_resources[] = { +static const struct resource tc6393xb_mmc_resources[] = { { .start = 0x800, .end = 0x9ff, @@ -192,7 +192,7 @@ static const struct resource tc6393xb_ohci_resources[] = { }, }; -static struct resource tc6393xb_fb_resources[] = { +static const struct resource tc6393xb_fb_resources[] = { { .start = 0x5000, .end = 0x51ff, diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c index 6cdf6c315034..bd6235308c6b 100644 --- a/drivers/mfd/tps65090.c +++ b/drivers/mfd/tps65090.c @@ -38,7 +38,7 @@ #define TPS65090_INT2_MASK_OVERLOAD_FET6 6 #define TPS65090_INT2_MASK_OVERLOAD_FET7 7 -static struct resource charger_resources[] = { +static const struct resource charger_resources[] = { { .start = TPS65090_IRQ_VAC_STATUS_CHANGE, .end = TPS65090_IRQ_VAC_STATUS_CHANGE, diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c index 2d9c282ec917..8027b0a9e14f 100644 --- a/drivers/mfd/tps65217.c +++ b/drivers/mfd/tps65217.c @@ -33,12 +33,12 @@ #include <linux/mfd/core.h> #include <linux/mfd/tps65217.h> -static struct resource charger_resources[] = { +static const struct resource charger_resources[] = { DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_AC, "AC"), DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_USB, "USB"), }; -static struct resource pb_resources[] = { +static const struct resource pb_resources[] = { DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_PB, "PB"), }; diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c index c36597797ddd..c9303d3d6602 100644 --- a/drivers/mfd/tps6586x.c +++ b/drivers/mfd/tps6586x.c @@ -92,7 +92,7 @@ static const struct tps6586x_irq_data tps6586x_irqs[] = { [TPS6586X_INT_RTC_ALM2] = TPS6586X_IRQ(TPS6586X_INT_MASK4, 1 << 1), }; -static struct resource tps6586x_rtc_resources[] = { +static const struct resource tps6586x_rtc_resources[] = { { .start = TPS6586X_INT_RTC_ALM1, .end = TPS6586X_INT_RTC_ALM1, diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c index 11959021b50a..6e105cca27d4 100644 --- a/drivers/mfd/tps65910.c +++ b/drivers/mfd/tps65910.c @@ -21,7 +21,7 @@ #include <linux/of.h> #include <linux/of_device.h> -static struct resource rtc_resources[] = { +static const struct resource rtc_resources[] = { { .start = TPS65910_IRQ_RTC_ALARM, .end = TPS65910_IRQ_RTC_ALARM, @@ -292,8 +292,8 @@ static int tps65910_ck32k_init(struct tps65910 *tps65910, if (!pmic_pdata->en_ck32k_xtal) return 0; - ret = tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL, - DEVCTRL_CK32K_CTRL_MASK); + ret = regmap_clear_bits(tps65910->regmap, TPS65910_DEVCTRL, + DEVCTRL_CK32K_CTRL_MASK); if (ret < 0) { dev_err(tps65910->dev, "clear ck32k_ctrl failed: %d\n", ret); return ret; @@ -314,17 +314,17 @@ static int tps65910_sleepinit(struct tps65910 *tps65910, dev = tps65910->dev; /* enabling SLEEP device state */ - ret = tps65910_reg_set_bits(tps65910, TPS65910_DEVCTRL, - DEVCTRL_DEV_SLP_MASK); + ret = regmap_set_bits(tps65910->regmap, TPS65910_DEVCTRL, + DEVCTRL_DEV_SLP_MASK); if (ret < 0) { dev_err(dev, "set dev_slp failed: %d\n", ret); goto err_sleep_init; } if (pmic_pdata->slp_keepon.therm_keepon) { - ret = tps65910_reg_set_bits(tps65910, - TPS65910_SLEEP_KEEP_RES_ON, - SLEEP_KEEP_RES_ON_THERM_KEEPON_MASK); + ret = regmap_set_bits(tps65910->regmap, + TPS65910_SLEEP_KEEP_RES_ON, + SLEEP_KEEP_RES_ON_THERM_KEEPON_MASK); if (ret < 0) { dev_err(dev, "set therm_keepon failed: %d\n", ret); goto disable_dev_slp; @@ -332,9 +332,9 @@ static int tps65910_sleepinit(struct tps65910 *tps65910, } if (pmic_pdata->slp_keepon.clkout32k_keepon) { - ret = tps65910_reg_set_bits(tps65910, - TPS65910_SLEEP_KEEP_RES_ON, - SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_MASK); + ret = regmap_set_bits(tps65910->regmap, + TPS65910_SLEEP_KEEP_RES_ON, + SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_MASK); if (ret < 0) { dev_err(dev, "set clkout32k_keepon failed: %d\n", ret); goto disable_dev_slp; @@ -342,9 +342,9 @@ static int tps65910_sleepinit(struct tps65910 *tps65910, } if (pmic_pdata->slp_keepon.i2chs_keepon) { - ret = tps65910_reg_set_bits(tps65910, - TPS65910_SLEEP_KEEP_RES_ON, - SLEEP_KEEP_RES_ON_I2CHS_KEEPON_MASK); + ret = regmap_set_bits(tps65910->regmap, + TPS65910_SLEEP_KEEP_RES_ON, + SLEEP_KEEP_RES_ON_I2CHS_KEEPON_MASK); if (ret < 0) { dev_err(dev, "set i2chs_keepon failed: %d\n", ret); goto disable_dev_slp; @@ -354,8 +354,8 @@ static int tps65910_sleepinit(struct tps65910 *tps65910, return 0; disable_dev_slp: - tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL, - DEVCTRL_DEV_SLP_MASK); + regmap_clear_bits(tps65910->regmap, TPS65910_DEVCTRL, + DEVCTRL_DEV_SLP_MASK); err_sleep_init: return ret; @@ -436,12 +436,18 @@ static void tps65910_power_off(void) tps65910 = dev_get_drvdata(&tps65910_i2c_client->dev); - if (tps65910_reg_set_bits(tps65910, TPS65910_DEVCTRL, - DEVCTRL_PWR_OFF_MASK) < 0) + /* + * The PWR_OFF bit needs to be set separately, before transitioning + * to the OFF state. It enables the "sequential" power-off mode on + * TPS65911, it's a NO-OP on TPS65910. + */ + if (regmap_set_bits(tps65910->regmap, TPS65910_DEVCTRL, + DEVCTRL_PWR_OFF_MASK) < 0) return; - tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL, - DEVCTRL_DEV_ON_MASK); + regmap_update_bits(tps65910->regmap, TPS65910_DEVCTRL, + DEVCTRL_DEV_OFF_MASK | DEVCTRL_DEV_ON_MASK, + DEVCTRL_DEV_OFF_MASK); } static int tps65910_i2c_probe(struct i2c_client *i2c, diff --git a/drivers/mfd/tps65911-comparator.c b/drivers/mfd/tps65911-comparator.c index 2334cd61c98d..8f4210075913 100644 --- a/drivers/mfd/tps65911-comparator.c +++ b/drivers/mfd/tps65911-comparator.c @@ -69,7 +69,7 @@ static int comp_threshold_set(struct tps65910 *tps65910, int id, int voltage) return -EINVAL; val = index << 1; - ret = tps65910_reg_write(tps65910, tps_comp.reg, val); + ret = regmap_write(tps65910->regmap, tps_comp.reg, val); return ret; } @@ -80,7 +80,7 @@ static int comp_threshold_get(struct tps65910 *tps65910, int id) unsigned int val; int ret; - ret = tps65910_reg_read(tps65910, tps_comp.reg, &val); + ret = regmap_read(tps65910->regmap, tps_comp.reg, &val); if (ret < 0) return ret; diff --git a/drivers/mfd/tps80031.c b/drivers/mfd/tps80031.c index 907452b86e32..902e33548dd0 100644 --- a/drivers/mfd/tps80031.c +++ b/drivers/mfd/tps80031.c @@ -34,7 +34,7 @@ #include <linux/regmap.h> #include <linux/slab.h> -static struct resource tps80031_rtc_resources[] = { +static const struct resource tps80031_rtc_resources[] = { { .start = TPS80031_INT_RTC_ALARM, .end = TPS80031_INT_RTC_ALARM, diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c index aff2dfbf3bf9..97af6c2a6007 100644 --- a/drivers/mfd/twl6030-irq.c +++ b/drivers/mfd/twl6030-irq.c @@ -356,7 +356,7 @@ static const struct irq_domain_ops twl6030_irq_domain_ops = { .xlate = irq_domain_xlate_onetwocell, }; -static const struct of_device_id twl6030_of_match[] = { +static const struct of_device_id twl6030_of_match[] __maybe_unused = { {.compatible = "ti,twl6030", &twl6030_interrupt_mapping}, {.compatible = "ti,twl6032", &twl6032_interrupt_mapping}, { }, diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c index b0344e5353e4..bcef08f58fb3 100644 --- a/drivers/mfd/wm831x-core.c +++ b/drivers/mfd/wm831x-core.c @@ -616,7 +616,7 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg, } EXPORT_SYMBOL_GPL(wm831x_set_bits); -static struct resource wm831x_dcdc1_resources[] = { +static const struct resource wm831x_dcdc1_resources[] = { { .start = WM831X_DC1_CONTROL_1, .end = WM831X_DC1_DVS_CONTROL, @@ -637,7 +637,7 @@ static struct resource wm831x_dcdc1_resources[] = { }; -static struct resource wm831x_dcdc2_resources[] = { +static const struct resource wm831x_dcdc2_resources[] = { { .start = WM831X_DC2_CONTROL_1, .end = WM831X_DC2_DVS_CONTROL, @@ -657,7 +657,7 @@ static struct resource wm831x_dcdc2_resources[] = { }, }; -static struct resource wm831x_dcdc3_resources[] = { +static const struct resource wm831x_dcdc3_resources[] = { { .start = WM831X_DC3_CONTROL_1, .end = WM831X_DC3_SLEEP_CONTROL, @@ -671,7 +671,7 @@ static struct resource wm831x_dcdc3_resources[] = { }, }; -static struct resource wm831x_dcdc4_resources[] = { +static const struct resource wm831x_dcdc4_resources[] = { { .start = WM831X_DC4_CONTROL, .end = WM831X_DC4_SLEEP_CONTROL, @@ -685,7 +685,7 @@ static struct resource wm831x_dcdc4_resources[] = { }, }; -static struct resource wm8320_dcdc4_buck_resources[] = { +static const struct resource wm8320_dcdc4_buck_resources[] = { { .start = WM831X_DC4_CONTROL, .end = WM832X_DC4_SLEEP_CONTROL, @@ -699,7 +699,7 @@ static struct resource wm8320_dcdc4_buck_resources[] = { }, }; -static struct resource wm831x_gpio_resources[] = { +static const struct resource wm831x_gpio_resources[] = { { .start = WM831X_IRQ_GPIO_1, .end = WM831X_IRQ_GPIO_16, @@ -707,7 +707,7 @@ static struct resource wm831x_gpio_resources[] = { }, }; -static struct resource wm831x_isink1_resources[] = { +static const struct resource wm831x_isink1_resources[] = { { .start = WM831X_CURRENT_SINK_1, .end = WM831X_CURRENT_SINK_1, @@ -720,7 +720,7 @@ static struct resource wm831x_isink1_resources[] = { }, }; -static struct resource wm831x_isink2_resources[] = { +static const struct resource wm831x_isink2_resources[] = { { .start = WM831X_CURRENT_SINK_2, .end = WM831X_CURRENT_SINK_2, @@ -733,7 +733,7 @@ static struct resource wm831x_isink2_resources[] = { }, }; -static struct resource wm831x_ldo1_resources[] = { +static const struct resource wm831x_ldo1_resources[] = { { .start = WM831X_LDO1_CONTROL, .end = WM831X_LDO1_SLEEP_CONTROL, @@ -747,7 +747,7 @@ static struct resource wm831x_ldo1_resources[] = { }, }; -static struct resource wm831x_ldo2_resources[] = { +static const struct resource wm831x_ldo2_resources[] = { { .start = WM831X_LDO2_CONTROL, .end = WM831X_LDO2_SLEEP_CONTROL, @@ -761,7 +761,7 @@ static struct resource wm831x_ldo2_resources[] = { }, }; -static struct resource wm831x_ldo3_resources[] = { +static const struct resource wm831x_ldo3_resources[] = { { .start = WM831X_LDO3_CONTROL, .end = WM831X_LDO3_SLEEP_CONTROL, @@ -775,7 +775,7 @@ static struct resource wm831x_ldo3_resources[] = { }, }; -static struct resource wm831x_ldo4_resources[] = { +static const struct resource wm831x_ldo4_resources[] = { { .start = WM831X_LDO4_CONTROL, .end = WM831X_LDO4_SLEEP_CONTROL, @@ -789,7 +789,7 @@ static struct resource wm831x_ldo4_resources[] = { }, }; -static struct resource wm831x_ldo5_resources[] = { +static const struct resource wm831x_ldo5_resources[] = { { .start = WM831X_LDO5_CONTROL, .end = WM831X_LDO5_SLEEP_CONTROL, @@ -803,7 +803,7 @@ static struct resource wm831x_ldo5_resources[] = { }, }; -static struct resource wm831x_ldo6_resources[] = { +static const struct resource wm831x_ldo6_resources[] = { { .start = WM831X_LDO6_CONTROL, .end = WM831X_LDO6_SLEEP_CONTROL, @@ -817,7 +817,7 @@ static struct resource wm831x_ldo6_resources[] = { }, }; -static struct resource wm831x_ldo7_resources[] = { +static const struct resource wm831x_ldo7_resources[] = { { .start = WM831X_LDO7_CONTROL, .end = WM831X_LDO7_SLEEP_CONTROL, @@ -831,7 +831,7 @@ static struct resource wm831x_ldo7_resources[] = { }, }; -static struct resource wm831x_ldo8_resources[] = { +static const struct resource wm831x_ldo8_resources[] = { { .start = WM831X_LDO8_CONTROL, .end = WM831X_LDO8_SLEEP_CONTROL, @@ -845,7 +845,7 @@ static struct resource wm831x_ldo8_resources[] = { }, }; -static struct resource wm831x_ldo9_resources[] = { +static const struct resource wm831x_ldo9_resources[] = { { .start = WM831X_LDO9_CONTROL, .end = WM831X_LDO9_SLEEP_CONTROL, @@ -859,7 +859,7 @@ static struct resource wm831x_ldo9_resources[] = { }, }; -static struct resource wm831x_ldo10_resources[] = { +static const struct resource wm831x_ldo10_resources[] = { { .start = WM831X_LDO10_CONTROL, .end = WM831X_LDO10_SLEEP_CONTROL, @@ -873,7 +873,7 @@ static struct resource wm831x_ldo10_resources[] = { }, }; -static struct resource wm831x_ldo11_resources[] = { +static const struct resource wm831x_ldo11_resources[] = { { .start = WM831X_LDO11_ON_CONTROL, .end = WM831X_LDO11_SLEEP_CONTROL, @@ -881,7 +881,7 @@ static struct resource wm831x_ldo11_resources[] = { }, }; -static struct resource wm831x_on_resources[] = { +static const struct resource wm831x_on_resources[] = { { .start = WM831X_IRQ_ON, .end = WM831X_IRQ_ON, @@ -890,7 +890,7 @@ static struct resource wm831x_on_resources[] = { }; -static struct resource wm831x_power_resources[] = { +static const struct resource wm831x_power_resources[] = { { .name = "SYSLO", .start = WM831X_IRQ_PPM_SYSLO, @@ -959,7 +959,7 @@ static struct resource wm831x_power_resources[] = { }, }; -static struct resource wm831x_rtc_resources[] = { +static const struct resource wm831x_rtc_resources[] = { { .name = "PER", .start = WM831X_IRQ_RTC_PER, @@ -974,7 +974,7 @@ static struct resource wm831x_rtc_resources[] = { }, }; -static struct resource wm831x_status1_resources[] = { +static const struct resource wm831x_status1_resources[] = { { .start = WM831X_STATUS_LED_1, .end = WM831X_STATUS_LED_1, @@ -982,7 +982,7 @@ static struct resource wm831x_status1_resources[] = { }, }; -static struct resource wm831x_status2_resources[] = { +static const struct resource wm831x_status2_resources[] = { { .start = WM831X_STATUS_LED_2, .end = WM831X_STATUS_LED_2, @@ -990,7 +990,7 @@ static struct resource wm831x_status2_resources[] = { }, }; -static struct resource wm831x_touch_resources[] = { +static const struct resource wm831x_touch_resources[] = { { .name = "TCHPD", .start = WM831X_IRQ_TCHPD, @@ -1005,7 +1005,7 @@ static struct resource wm831x_touch_resources[] = { }, }; -static struct resource wm831x_wdt_resources[] = { +static const struct resource wm831x_wdt_resources[] = { { .start = WM831X_IRQ_WDOG_TO, .end = WM831X_IRQ_WDOG_TO, diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 3b2b93c5bbcb..7b1d270722ba 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c @@ -40,7 +40,7 @@ static const struct mfd_cell wm8994_regulator_devs[] = { }, }; -static struct resource wm8994_codec_resources[] = { +static const struct resource wm8994_codec_resources[] = { { .start = WM8994_IRQ_TEMP_SHUT, .end = WM8994_IRQ_TEMP_WARN, @@ -48,7 +48,7 @@ static struct resource wm8994_codec_resources[] = { }, }; -static struct resource wm8994_gpio_resources[] = { +static const struct resource wm8994_gpio_resources[] = { { .start = WM8994_IRQ_GPIO(1), .end = WM8994_IRQ_GPIO(11), @@ -683,7 +683,7 @@ static struct i2c_driver wm8994_i2c_driver = { .driver = { .name = "wm8994", .pm = &wm8994_pm_ops, - .of_match_table = of_match_ptr(wm8994_of_match), + .of_match_table = wm8994_of_match, }, .probe = wm8994_i2c_probe, .remove = wm8994_i2c_remove, |