Re: [PATCH v2] power: Fix unmet dependency on POWER_SUPPLY by POWER_RESET by uncoupling them

2015-12-08 Thread Sebastian Reichel
Hi,

On Mon, Dec 07, 2015 at 12:45:12PM +0900, Krzysztof Kozlowski wrote:
> Currently the reset/power off handlers (POWER_RESET) and Adaptive Voltage
> Scaling class (POWER_AVS) are not built when POWER_SUPPLY is disabled.
> The POWER_RESET is also not visible in drivers main section of config.
> 
> However they do not really depend on power supply so they can be built
> always. The objects for power supply drivers already depend on
> particular Kconfig symbols so there is no need for any changes in
> drivers/power/Makefile.
> 
> This allows selecting POWER_RESET from main drivers config section and
> fixes following build warning (encountered on ARM exynos defconfig when
> POWER_SUPPLY is disabled manually):
> 
> warning: (ARCH_HISI && ARCH_INTEGRATOR && ARCH_EXYNOS && ARCH_VEXPRESS && 
> REALVIEW_DT) selects POWER_RESET which has unmet direct dependencies 
> (POWER_SUPPLY)
> warning: (ARCH_EXYNOS) selects POWER_RESET_SYSCON which has unmet direct 
> dependencies (POWER_SUPPLY && POWER_RESET && OF)
> warning: (ARCH_EXYNOS) selects POWER_RESET_SYSCON_POWEROFF which has unmet 
> direct dependencies (POWER_SUPPLY && POWER_RESET && OF)
> 
> Reported-by: Pavel Fedin 
> Signed-off-by: Krzysztof Kozlowski 

Thanks, queued.

-- Sebastian


signature.asc
Description: PGP signature


Re: [PATCH 1/2] power: Fix unmet dependency on POWER_SUPPLY by POWER_RESET by uncoupling them

2015-12-04 Thread Sebastian Reichel
Hi,

On Wed, Dec 02, 2015 at 02:59:06PM +0900, Krzysztof Kozlowski wrote:
> Actually reset/power off handlers do not really depend on power supply.
> Move the power reset out of power supply block so it will appear in main
> drivers section. This fixes following build warning (encountered on ARM
> exynos defconfig when POWER_SUPPLY is disabled manually):
> 
> warning: (ARCH_HISI && ARCH_INTEGRATOR && ARCH_EXYNOS && ARCH_VEXPRESS && 
> REALVIEW_DT) selects POWER_RESET which has unmet direct dependencies 
> (POWER_SUPPLY)
> warning: (ARCH_EXYNOS) selects POWER_RESET_SYSCON which has unmet direct 
> dependencies (POWER_SUPPLY && POWER_RESET && OF)
> warning: (ARCH_EXYNOS) selects POWER_RESET_SYSCON_POWEROFF which has unmet 
> direct dependencies (POWER_SUPPLY && POWER_RESET && OF)

nice catch. I don't really like the Makefile changes, though. I think
it would be better to make the power/ entry in drivers/Makefile into
"obj-y" and handle the details in drivers/power/Makefile.

-- Sebastian


signature.asc
Description: PGP signature


Re: [PATCH 1/2] power_supply: max17042: Add OF support for setting thresholds

2015-06-10 Thread Sebastian Reichel
Hi,

On Mon, Jun 08, 2015 at 10:11:38AM +0900, Krzysztof Kozlowski wrote:
 The commit edd4ab055931 (power: max17042_battery: add HEALTH and TEMP_*
 properties support) added support for setting voltage and temperature
 thresholds with platform data. For DeviceTree default of 0 was always
 used.
 
 This caused reporting battery health always as over voltage or
 over heated.
 
 Signed-off-by: Krzysztof Kozlowski k.kozlow...@samsung.com
 Fixes: edd4ab055931 (power: max17042_battery: add HEALTH and TEMP_* 
 properties support)

Thanks, queued.

-- Sebastian


signature.asc
Description: Digital signature


Re: [PATCH 1/2] power: reset: add driver for Hardkernel's Odroid boards

2015-01-21 Thread Sebastian Reichel
Hi,

On Wed, Oct 29, 2014 at 02:13:28PM +0100, Marek Szyprowski wrote:
 This patch adds a driver implementing correct reboot and poweroff
 procedures for Exynos4412-based Hardkernel's Odroid X/X2/U2/U3/U3+
 boards.

Sorry it took so long. I have a couple of small requests before
applying this (comments inline).

 Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
 ---
  .../bindings/power/reset/odroid-reset.txt  |  18 
  drivers/power/reset/Kconfig|   6 ++
  drivers/power/reset/Makefile   |   1 +
  drivers/power/reset/odroid-reboot.c| 119 
 +
  4 files changed, 144 insertions(+)
  create mode 100644 
 Documentation/devicetree/bindings/power/reset/odroid-reset.txt
  create mode 100644 drivers/power/reset/odroid-reboot.c
 
 diff --git a/Documentation/devicetree/bindings/power/reset/odroid-reset.txt 
 b/Documentation/devicetree/bindings/power/reset/odroid-reset.txt
 new file mode 100644
 index ..86471a463518
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/power/reset/odroid-reset.txt
 @@ -0,0 +1,18 @@
 +* Device tree bindings for Hardkernel's Exynos4412 based Odroid boards
 +
 +This node is intended to allow proper system reboot and power off of
 +Odroid X/X2/U2/U3/U3+ boards with eMMC storage. Without this node, board
 +hangs during standard reset procedure.
 +
 +Required properties:
 +- compatible:hardkernel,odroid-reboot
 +- samsung,pmureg-phandle:phandle to Exynos PMU node
 +- reset-gpios:   phandle and gpio-specifier to the GPIO 
 pin
 + connected to the eMMC_nDET
 +
 +Example:
 +odroid_reboot {
 + compatible = hardkernel,odroid-reboot;
 + samsung,pmureg-phandle = pmu_system_controller;
 + reset-gpio = gpk1 2 0;
 +};
 diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
 index f65ff49bb275..f02b13d5344f 100644
 --- a/drivers/power/reset/Kconfig
 +++ b/drivers/power/reset/Kconfig
 @@ -84,6 +84,12 @@ config POWER_RESET_LTC2952
 This driver supports an external powerdown trigger and board power
 down via the LTC2952. Bindings are made in the device tree.
  
 +config POWER_RESET_ODROID
 + bool Hardkernel's Exynos4412 based Odroid reboot driver
 + depends on POWER_RESET  ARCH_EXYNOS

once the arm specific restart handler is gone you can add ||
COMPILE_TEST

 + help
 +   Power off and restart support for Odroid boards.
 +
  config POWER_RESET_QNAP
   bool QNAP power-off driver
   depends on OF_GPIO  PLAT_ORION
 diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile
 index 76ce1c59469b..178ee86eb813 100644
 --- a/drivers/power/reset/Makefile
 +++ b/drivers/power/reset/Makefile
 @@ -8,6 +8,7 @@ obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o
  obj-$(CONFIG_POWER_RESET_HISI) += hisi-reboot.o
  obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o
  obj-$(CONFIG_POWER_RESET_LTC2952) += ltc2952-poweroff.o
 +obj-$(CONFIG_POWER_RESET_ODROID) += odroid-reboot.o
  obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o
  obj-$(CONFIG_POWER_RESET_RESTART) += restart-poweroff.o
  obj-$(CONFIG_POWER_RESET_SUN6I) += sun6i-reboot.o
 diff --git a/drivers/power/reset/odroid-reboot.c 
 b/drivers/power/reset/odroid-reboot.c
 new file mode 100644
 index ..823e93539220
 --- /dev/null
 +++ b/drivers/power/reset/odroid-reboot.c
 @@ -0,0 +1,119 @@
 +/*
 + * Copyright (c) 2014 Samsung Electronics Co., Ltd.
 + *   http://www.samsung.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License as published by
 + * the Free Software Foundation; either version 2 of the License, or
 + * (at your option) any later version.
 + */
 +
 +#include linux/delay.h
 +#include linux/gpio.h
 +#include linux/io.h
 +#include linux/mfd/syscon.h
 +#include linux/module.h
 +#include linux/of_platform.h
 +#include linux/of_gpio.h
 +#include linux/reboot.h
 +#include linux/regmap.h
 +
 +#include asm/system_misc.h
 +
 +#define PS_HOLD_CONTROL  0x330C
 +
 +struct odroid_reboot_data {
 + struct device *dev;
 + int power_gpio;
 + struct regmap *reg_pmu;
 + void (*reboot_func)(enum reboot_mode mode, const char *cmd);
 +};
 +
 +static struct odroid_reboot_data *reboot_data;
 +
 +static void odroid_reboot(enum reboot_mode mode, const char *cmd)
 +{
 + local_irq_disable();
 +
 + gpio_set_value(reboot_data-power_gpio, 0);
 + mdelay(150);
 + gpio_set_value(reboot_data-power_gpio, 1);
 +
 + reboot_data-reboot_func(mode, cmd);
 +
 + pr_emerg(%s: waiting for reboot\n, __func__);
 + while (1)
 + ;
 +}
 +
 +static void odroid_power_off(void)
 +{
 + regmap_update_bits(reboot_data-reg_pmu, PS_HOLD_CONTROL, 0x, 
 0x5200);
 + while (1) {
 + pr_emerg(%s: should not reach here!\n, __func__);
 + 

Re: [PATCH v7 02/11] power/restart: Call machine_restart instead of arm_pm_restart

2014-08-21 Thread Sebastian Reichel
Hi,

On Tue, Aug 19, 2014 at 05:45:29PM -0700, Guenter Roeck wrote:
 machine_restart is supported on non-ARM platforms, and and ultimately calls
 arm_pm_restart, so dont call arm_pm_restart directly but use the more
 generic function.
 
 Cc: Russell King li...@arm.linux.org.uk
 Signed-off-by: Guenter Roeck li...@roeck-us.net
 Acked-by: Catalin Marinas catalin.mari...@arm.com
 Acked-by: Heiko Stuebner he...@sntech.de

Acked-by: Sebastian Reichel s...@kernel.org

Do you want me to take the patch via battery-2.6.git?

-- Sebastian


signature.asc
Description: Digital signature


Re: [PATCH 0/2] sbs-battery: Add missing power class sysfs files

2014-08-05 Thread Sebastian Reichel
On Mon, Aug 04, 2014 at 01:47:44PM +0200, Javier Martinez Canillas wrote:
 This series add the model_name, manufacturer and voltage_min_design
 files from the power supply monitor class sysfs interface that were
 missing for the sbs-battery driver. The commits were taken from the
 Chrome OS 3.8 downstream kernel and patches were squashed when they
 just fixed bugs introduced on previous commits that do the export.
 
 The patch-set was tested on a Exynos5420 based Peach Pit machine by
 confirming that the sysfs files existed and provide the right data:
 
 # cat 
 /sys/class/power_supply/sbs-20-000b/{voltage_min_design,manufacturer,model_name}
 750
 SANYO
 4302A40
 
 Simon Que (1):
   sbs-battery: add min design voltage to sbs-battery
 
 cychiang (1):
   sbs-battery: export manufacturer and model name to sysfs
 
  drivers/power/sbs-battery.c | 125 
 +++-
  1 file changed, 123 insertions(+), 2 deletions(-)
 
 Best regards,
 Javier

Both applied to battery.git's next-next branch. I modified the
author from the first commit (cychiang cychi...@chromium.org),
so that it's equal to the signed-off line (Cheng-Yi Chiang
cychi...@chromium.org).

-- Sebastian


signature.asc
Description: Digital signature


Re: [RESEND PATCH v3] charger: tps65090: Allow charger module to be used when no irq

2014-07-17 Thread Sebastian Reichel
Hi,

On Fri, Jun 20, 2014 at 02:42:03PM -0700, Doug Anderson wrote:
 On the ARM Chromebook tps65090 has two masters: the AP (the main
 processor running linux) and the EC (the embedded controller).  The AP
 is allowed to mess with FETs but the EC is in charge of charge control.
 
 The tps65090 interupt line is routed to both the AP and the EC, which
 can cause quite a headache.  Having two people adjusting masks and
 acking interrupts is a recipe for disaster.
 
 In the shipping kernel we had a hack to have the AP pay attention to
 the IRQ but not to ack it.  It also wasn't supposed to configure the
 IRQ in any way.  That hack allowed us to detect when the device was
 charging without messing with the EC's state.
 
 The current tps65090 infrastructure makes the above difficult, and it
 was a bit of a hack to begin with.  Rather than uglify the driver to
 support it, just extend the driver's existing notion of no irq to
 the charger.  This makes the charger code poll every 2 seconds for AC
 detect, which is sufficient.
 
 For proper functioning, requires (mfd: tps65090: Don't tell child
 devices we have an IRQ if we don't).  If we don't have that patch
 we'll simply fail to probe on devices without an interrupt (just like
 we did before this patch).

Applied to the dev branch, which I use until I get access to the
official battery.git:

https://git.kernel.org/cgit/linux/kernel/git/sre/linux-power-supply.git/commit/?h=devid=5a3effdc8877132fd12f97fea0d4756614b911c7

-- Sebastian


signature.asc
Description: Digital signature