Merge tag 'for-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 22 Feb 2021 17:49:59 +0000 (09:49 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 22 Feb 2021 17:49:59 +0000 (09:49 -0800)
Pull power supply and reset updates from Sebastian Reichel:
 "Battery/charger driver changes:
   - acer_a500: new fuel gauge driver for Acer Iconia Tab A500
   - bq256xx: new charger driver
   - bq27xxx: Support CHARGE_NOW for bq27z561/bq28z610/bq34z100
   - bq27xxx: Fix inverted CURRENT_NOW sign
   - cpcap: rework fuel gauge and charger drivers
   - ltc4162l: new charger driver
   - max8997-charger: add extcon based current limit configuration
   - max8903, wm97xx, z2: convert to GPIO descriptors (incl. ARM board files)
   - misc cleanup and fixes

  Reset drivers:
   - new poweroff driver for ATC260x
   - at91-sama5d2_shdwc: add support for sama7g5
   - drop zte zx driver (SoC support is removed from kernel)"

* tag 'for-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (55 commits)
  power-supply: use kobj_to_dev()
  power: supply: charger-manager: fix typo
  power/reset: remove zte zx driver
  power: supply: bq25980: Fix repetive bq25975 with bq25960
  power: supply: smb347-charger: Fix interrupt usage if interrupt is unavailable
  power: supply: axp20x_usb_power: Init work before enabling IRQs
  power: supply: fix sbs-charger build, needs REGMAP_I2C
  power: supply: bq27xxx: fix polarity of current_now
  power: supply: charger-manager: fix incorrect health status
  power: reset: at91-sama5d2_shdwc: add support for sama7g5
  dt-bindings: atmel-sysreg: add microchip,sama7g5-shdwc
  power: reset: at91-sama5d2_shdwc: fix wkupdbc mask
  dt-bindings: power/supply: Add ltc4162-l-charger
  power: supply: bq24190_charger: convert comma to semicolon
  power: supply: ab8500_fg: convert comma to semicolon
  power: supply: ds2780: Switch to using the new API kobj_to_dev()
  power: supply: bq27xxx: Support CHARGE_NOW for bq27z561/bq28z610/bq34z100
  power: supply: cpcap-charger: Fix power_supply_put on null battery pointer
  power: supply: cpcap-battery: constify psy_desc
  power: supply: cpcap-battery: Fix typo
  ...

1  2 
Documentation/devicetree/bindings/arm/atmel-sysregs.txt
arch/arm/mach-pxa/z2.c

@@@ -1,7 -1,7 +1,7 @@@
  Atmel system registers
  
  Chipid required properties:
 -- compatible: Should be "atmel,sama5d2-chipid"
 +- compatible: Should be "atmel,sama5d2-chipid" or "microchip,sama7g5-chipid"
  - reg : Should contain registers location and length
  
  PIT Timer required properties:
@@@ -91,7 -91,8 +91,8 @@@ SHDWC SAMA5D2-Compatible Shutdown Contr
  1) shdwc node
  
  required properties:
- - compatible: should be "atmel,sama5d2-shdwc" or "microchip,sam9x60-shdwc".
+ - compatible: should be "atmel,sama5d2-shdwc", "microchip,sam9x60-shdwc" or
+   "microchip,sama7g5-shdwc"
  - reg: should contain registers location and length
  - clocks: phandle to input clock.
  - #address-cells: should be one. The cell is the wake-up input index.
@@@ -103,7 -104,7 +104,7 @@@ optional properties
    microseconds. It's usually a board-related property.
  - atmel,wakeup-rtc-timer: boolean to enable Real-Time Clock wake-up.
  
- optional microchip,sam9x60-shdwc properties:
+ optional microchip,sam9x60-shdwc or microchip,sama7g5-shdwc properties:
  - atmel,wakeup-rtt-timer: boolean to enable Real-time Timer Wake-up.
  
  The node contains child nodes for each wake-up input that the platform uses.
diff --combined arch/arm/mach-pxa/z2.c
@@@ -20,6 -20,7 +20,6 @@@
  #include <linux/spi/spi.h>
  #include <linux/spi/pxa2xx_spi.h>
  #include <linux/spi/libertas_spi.h>
 -#include <linux/spi/lms283gf05.h>
  #include <linux/power_supply.h>
  #include <linux/mtd/physmap.h>
  #include <linux/gpio.h>
@@@ -487,7 -488,6 +487,6 @@@ static struct z2_battery_info batt_chip
        .batt_I2C_bus   = 0,
        .batt_I2C_addr  = 0x55,
        .batt_I2C_reg   = 2,
-       .charge_gpio    = GPIO0_ZIPITZ2_AC_DETECT,
        .min_voltage    = 3475000,
        .max_voltage    = 4190000,
        .batt_div       = 59,
        .batt_name      = "Z2",
  };
  
+ static struct gpiod_lookup_table z2_battery_gpio_table = {
+       .dev_id = "aer915",
+       .table = {
+               GPIO_LOOKUP("gpio-pxa", GPIO0_ZIPITZ2_AC_DETECT,
+                           NULL, GPIO_ACTIVE_HIGH),
+               { },
+       },
+ };
  static struct i2c_board_info __initdata z2_i2c_board_info[] = {
        {
                I2C_BOARD_INFO("aer915", 0x55),
+               .dev_name = "aer915",
                .platform_data  = &batt_chip_info,
        }, {
                I2C_BOARD_INFO("wm8750", 0x1b),
  static void __init z2_i2c_init(void)
  {
        pxa_set_i2c_info(NULL);
+       gpiod_add_lookup_table(&z2_battery_gpio_table);
        i2c_register_board_info(0, ARRAY_AND_SIZE(z2_i2c_board_info));
  }
  #else
@@@ -577,13 -588,8 +587,13 @@@ static struct pxa2xx_spi_chip lms283_ch
        .gpio_cs        = GPIO88_ZIPITZ2_LCD_CS,
  };
  
 -static const struct lms283gf05_pdata lms283_pdata = {
 -      .reset_gpio     = GPIO19_ZIPITZ2_LCD_RESET,
 +static struct gpiod_lookup_table lms283_gpio_table = {
 +      .dev_id = "spi2.0", /* SPI bus 2 chip select 0 */
 +      .table = {
 +              GPIO_LOOKUP("gpio-pxa", GPIO19_ZIPITZ2_LCD_RESET,
 +                          "reset", GPIO_ACTIVE_LOW),
 +              { },
 +      },
  };
  
  static struct spi_board_info spi_board_info[] __initdata = {
  {
        .modalias               = "lms283gf05",
        .controller_data        = &lms283_chip_info,
 -      .platform_data          = &lms283_pdata,
        .max_speed_hz           = 400000,
        .bus_num                = 2,
        .chip_select            = 0,
@@@ -618,7 -625,6 +628,7 @@@ static void __init z2_spi_init(void
  {
        pxa2xx_set_spi_info(1, &pxa_ssp1_master_info);
        pxa2xx_set_spi_info(2, &pxa_ssp2_master_info);
 +      gpiod_add_lookup_table(&lms283_gpio_table);
        spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
  }
  #else