Commit 11c33652 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull power supply and reset updates from Sebastian Reichel:
 "Battery/charger driver changes:

   - collie_battery, generic-adc-battery, s3c-adc-battery: convert to
     GPIO descriptors (incl ARM board files)

   - misc cleanup and fixes

  Reset drivers:

   - new poweroff driver for force disabling a regulator

   - use printk format symbol resolver

   - ocelot: add support for Luton and Jaguar2"

* tag 'for-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (31 commits)
  power: supply: Fix a typo in warning message
  Documentation: DT: binding documentation for regulator-poweroff
  power: reset: new driver regulator-poweroff
  power: supply: ab8500: Use dev_err_probe() for IIO channels
  power: supply: ab8500_fg: Request all IRQs as threaded
  power: supply: ab8500_charger: Oneshot threaded IRQs
  power: supply: ab8500: Convert to dev_pm_ops
  power: supply: ab8500: Use local helper
  power: supply: wm831x_power: remove unneeded break
  power: supply: bq24735: Drop unused include
  power: supply: bq24190_charger: Drop unused include
  power: supply: generic-adc-battery: Use GPIO descriptors
  power: supply: collie_battery: Convert to GPIO descriptors
  power: supply: bq24190_charger: fix reference leak
  power: supply: s3c-adc-battery: Convert to GPIO descriptors
  power: reset: Use printk format symbol resolver
  power: supply: axp20x_usb_power: Use power efficient workqueue for debounce
  power: supply: axp20x_usb_power: fix typo
  power: supply: max8997-charger: Improve getting charger status
  power: supply: max8997-charger: Fix platform data retrieval
  ...
parents c2703b66 c2362519
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -7,7 +7,9 @@ The reset registers are both present in the MSCC vcoreiii MIPS and
microchip Sparx5 armv8 SoC's.

Required Properties:
 - compatible: "mscc,ocelot-chip-reset" or "microchip,sparx5-chip-reset"

 - compatible: "mscc,ocelot-chip-reset", "mscc,luton-chip-reset",
   "mscc,jaguar2-chip-reset" or "microchip,sparx5-chip-reset"

Example:
	reset@1070008 {
+37 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/reset/regulator-poweroff.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Force-disable power regulator to turn the power off.

maintainers:
  - Michael Klein <michael@fossekall.de>

description: |
  When the power-off handler is called, a power regulator is disabled by
  calling regulator_force_disable(). If the power is still on and the
  CPU still running after a 3000ms delay, a warning is emitted.

properties:
  compatible:
    const: "regulator-poweroff"

  cpu-supply:
    description:
      regulator to disable on power-down

required:
  - compatible
  - cpu-supply

additionalProperties: false

examples:
  - |
    regulator-poweroff {
        compatible = "regulator-poweroff";
        cpu-supply = <&reg_vcc1v2>;
    };
...
+10 −2
Original line number Diff line number Diff line
@@ -297,6 +297,15 @@ static const struct s3c_adc_bat_thresh bat_lut_acin[] = {
	{ .volt = 3841, .cur = 0, .level = 0},
};

static struct gpiod_lookup_table h1940_bat_gpio_table = {
	.dev_id = "s3c-adc-battery",
	.table = {
		/* Charge status S3C2410_GPF(3) */
		GPIO_LOOKUP("GPIOF", 3, "charge-status", GPIO_ACTIVE_LOW),
		{ },
	},
};

static int h1940_bat_init(void)
{
	int ret;
@@ -330,8 +339,6 @@ static struct s3c_adc_bat_pdata h1940_bat_cfg = {
	.exit = h1940_bat_exit,
	.enable_charger = h1940_enable_charger,
	.disable_charger = h1940_disable_charger,
	.gpio_charge_finished = S3C2410_GPF(3),
	.gpio_inverted = 1,
	.lut_noac = bat_lut_noac,
	.lut_noac_cnt = ARRAY_SIZE(bat_lut_noac),
	.lut_acin = bat_lut_acin,
@@ -720,6 +727,7 @@ static void __init h1940_init(void)
	s3c24xx_fb_set_platdata(&h1940_fb_info);
	gpiod_add_lookup_table(&h1940_mmc_gpio_table);
	gpiod_add_lookup_table(&h1940_audio_gpio_table);
	gpiod_add_lookup_table(&h1940_bat_gpio_table);
	/* Configure the I2S pins (GPE0...GPE4) in correct mode */
	s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
			      S3C_GPIO_PULL_NONE);
+10 −1
Original line number Diff line number Diff line
@@ -206,6 +206,15 @@ static const struct s3c_adc_bat_thresh bat_lut_acin[] = {
	{ .volt = 3820, .cur = 0, .level = 0},
};

static struct gpiod_lookup_table rx1950_bat_gpio_table = {
	.dev_id = "s3c-adc-battery",
	.table = {
		/* Charge status S3C2410_GPF(3) */
		GPIO_LOOKUP("GPIOF", 3, "charge-status", GPIO_ACTIVE_HIGH),
		{ },
	},
};

static int rx1950_bat_init(void)
{
	int ret;
@@ -331,7 +340,6 @@ static struct s3c_adc_bat_pdata rx1950_bat_cfg = {
	.exit = rx1950_bat_exit,
	.enable_charger = rx1950_enable_charger,
	.disable_charger = rx1950_disable_charger,
	.gpio_charge_finished = S3C2410_GPF(3),
	.lut_noac = bat_lut_noac,
	.lut_noac_cnt = ARRAY_SIZE(bat_lut_noac),
	.lut_acin = bat_lut_acin,
@@ -840,6 +848,7 @@ static void __init rx1950_init_machine(void)

	pwm_add_table(rx1950_pwm_lookup, ARRAY_SIZE(rx1950_pwm_lookup));
	gpiod_add_lookup_table(&rx1950_audio_gpio_table);
	gpiod_add_lookup_table(&rx1950_bat_gpio_table);
	/* Configure the I2S pins (GPE0...GPE4) in correct mode */
	s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
			      S3C_GPIO_PULL_NONE);
+21 −0
Original line number Diff line number Diff line
@@ -98,6 +98,26 @@ static struct mcp_plat_data collie_mcp_data = {
	.codec_pdata	= &collie_ucb1x00_data,
};

/* Battery management GPIOs */
static struct gpiod_lookup_table collie_battery_gpiod_table = {
	/* the MCP codec mcp0 has the ucb1x00 as attached device */
	.dev_id = "ucb1x00",
	.table = {
		/* This is found on the main GPIO on the SA1100 */
		GPIO_LOOKUP("gpio", COLLIE_GPIO_CO,
			    "main battery full", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("gpio", COLLIE_GPIO_MAIN_BAT_LOW,
			    "main battery low", GPIO_ACTIVE_HIGH),
		/*
		 * This is GPIO 0 on the Scoop expander, which is registered
		 * from common/scoop.c with this gpio chip label.
		 */
		GPIO_LOOKUP("sharp-scoop", 0,
			    "main charge on", GPIO_ACTIVE_HIGH),
		{ },
	},
};

static int collie_ir_startup(struct device *dev)
{
	int rc = gpio_request(COLLIE_GPIO_IR_ON, "IrDA");
@@ -395,6 +415,7 @@ static void __init collie_init(void)
	platform_scoop_config = &collie_pcmcia_config;

	gpiod_add_lookup_table(&collie_power_gpiod_table);
	gpiod_add_lookup_table(&collie_battery_gpiod_table);

	ret = platform_add_devices(devices, ARRAY_SIZE(devices));
	if (ret) {
Loading