Re: [PATCH 004/182] gpio: generic: factor into gpio_chip struct

2015-12-10 Thread Lee Jones
On Wed, 09 Dec 2015, Linus Walleij wrote:

> The separate struct bgpio_chip has been a pain to handle, both
> by being confusingly similar in name to struct gpio_chip and
> for being contained inside a struct so that struct gpio_chip
> is contained in a struct contained in a struct, making several
> steps of dereferencing necessary.
> 
> Make things simpler: include the fields directly into
> , #ifdef:ed for CONFIG_GENERIC_GPIO, and
> get rid of the  altogether. Prefix
> some of the member variables with bgpio_* and add proper
> kerneldoc while we're at it.
> 
> Modify all users to handle the change and use a struct
> gpio_chip directly. And while we're at it: replace all
> container_of() dereferencing by gpiochip_get_data() and
> registering the gpio_chip with gpiochip_add_data().
> 
> Cc: a...@kernel.org
> Cc: Lee Jones <lee.jo...@linaro.org>
> Cc: Alexander Shiyan <shc_w...@mail.ru>
> Cc: Shawn Guo <shawn...@kernel.org>
> Cc: Sascha Hauer <ker...@pengutronix.de>
> Cc: Tony Lindgren <t...@atomide.com>
> Cc: Kukjin Kim <kg...@kernel.org>
> Cc: Krzysztof Kozlowski <k.kozlow...@samsung.com>
> Cc: Alexandre Courbot <gnu...@gmail.com>
> Cc: Gregory Fong <gregory.0...@gmail.com>
> Cc: Brian Norris <computersforpe...@gmail.com>
> Cc: Florian Fainelli <f.faine...@gmail.com>
> Cc: Liviu Dudau <liviu.du...@arm.com>
> Cc: Sudeep Holla <sudeep.ho...@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieral...@arm.com>
> Cc: Nicolas Pitre <nicolas.pi...@linaro.org>
> Cc: Olof Johansson <o...@lixom.net>
> Cc: Vladimir Zapolskiy <vladimir_zapols...@mentor.com>
> Cc: Rabin Vincent <ra...@rab.in>
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-omap@vger.kernel.org
> Cc: linux-samsung-...@vger.kernel.org
> Cc: bcm-kernel-feedback-l...@broadcom.com
> Signed-off-by: Linus Walleij <linus.wall...@linaro.org>
> ---
> ARM SoC folks and Lee: it would be great if you could
> ACK the few lines hitting arch/arm/* and drivers/mfd/* in this
> so I can take it through the GPIO tree.
> ---
>  arch/arm/mach-clps711x/board-autcpu12.c |   2 +-
>  arch/arm/mach-clps711x/board-p720t.c|   2 +-
>  arch/arm/mach-imx/mach-mx21ads.c|   2 +-
>  arch/arm/mach-omap1/board-ams-delta.c   |   2 +-
>  arch/arm/mach-s3c64xx/mach-crag6410.c   |   2 +-
>  drivers/gpio/gpio-74xx-mmio.c   |  37 ++--
>  drivers/gpio/gpio-brcmstb.c |  80 -
>  drivers/gpio/gpio-clps711x.c|  28 +--
>  drivers/gpio/gpio-dwapb.c   |  92 +-
>  drivers/gpio/gpio-ep93xx.c  |  25 +--
>  drivers/gpio/gpio-etraxfs.c |  49 +++---
>  drivers/gpio/gpio-ge.c  |  24 +--
>  drivers/gpio/gpio-generic.c | 292 
> +++-
>  drivers/gpio/gpio-grgpio.c  |  73 
>  drivers/gpio/gpio-moxart.c          |  29 ++--
>  drivers/gpio/gpio-mxc.c |  27 ++-
>  drivers/gpio/gpio-mxs.c |  33 ++--
>  drivers/gpio/gpio-sodaville.c   |  13 +-
>  drivers/gpio/gpio-xgene-sb.c|  40 ++---
>  drivers/mfd/vexpress-sysreg.c   |   8 +-

Acked-by: Lee Jones <lee.jo...@linaro.org>

>  include/linux/basic_mmio_gpio.h |  80 -
>  include/linux/gpio/driver.h |  54 ++
>  22 files changed, 442 insertions(+), 552 deletions(-)
>  delete mode 100644 include/linux/basic_mmio_gpio.h

[...]

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] regulator: tps65218: add support for LS3 current regulator

2015-11-26 Thread Lee Jones
On Wed, 25 Nov 2015, Nikita Kiryanov wrote:

> Add support for TPS65218 LS3 current regulator, which is capable of 4
> current input limit modes: 100, 200, 500, and 1000 uA.
> 
> Signed-off-by: Nikita Kiryanov <nik...@compulab.co.il>
> Cc: Tony Lindgren <t...@atomide.com>
> Cc: Liam Girdwood <lgirdw...@gmail.com>
> Cc: Mark Brown <broo...@kernel.org>
> Cc: Samuel Ortiz <sa...@linux.intel.com>
> Cc: Lee Jones <lee.jo...@linaro.org>
> ---
>  drivers/regulator/tps65218-regulator.c | 137 
> +----
>  include/linux/mfd/tps65218.h   |   7 +-

Acked-by: Lee Jones <lee.jo...@linaro.org>

>  include/linux/regulator/driver.h   |   2 +
>  3 files changed, 115 insertions(+), 31 deletions(-)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 3/3] [media] include/media: move platform_data to linux/platform_data/media

2015-11-16 Thread Lee Jones
On Mon, 16 Nov 2015, Mauro Carvalho Chehab wrote:

> Let's not mix platform_data headers with the core headers. Instead, let's
> create a subdir at linux/platform_data and move the headers to that
> common place, adding it to MAINTAINERS.
> 
> The headers were moved with:
>   mkdir include/linux/platform_data/media/; git mv 
> include/media/gpio-ir-recv.h include/media/ir-rx51.h 
> include/media/mmp-camera.h include/media/omap1_camera.h 
> include/media/omap4iss.h include/media/s5p_hdmi.h include/media/si4713.h 
> include/media/sii9234.h include/media/smiapp.h include/media/soc_camera.h 
> include/media/soc_camera_platform.h include/media/timb_radio.h 
> include/media/timb_video.h include/linux/platform_data/media/
> 
> And the references fixed with this script:
> MAIN_DIR="linux/platform_data/"
> PREV_DIR="media/"
> DIRS="media/"
> 
> echo "Checking affected files" >&2
> for i in $DIRS; do
>   for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do
>n=`basename $j`
>   git grep -l $n
>   done
> done|sort|uniq >files && (
>   echo "Handling files..." >&2;
>   echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\";
>   (
>   cd include/$MAIN_DIR;
>   for j in $DIRS; do
>   for i in $(ls $j); do
>   echo "perl -ne 's,(include 
> [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\";
>   done;
>   done;
>   echo "cat > a && mv a \$i; done";
>   );
>   echo "Handling documentation..." >&2;
>   echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\";
>   (
>   cd include/$MAIN_DIR;
>   for j in $DIRS; do
>   for i in $(ls $j); do
>   echo "  perl -ne 
> 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\";
>   done;
>   done;
>   echo "cat > a && mv a \$i; done"
>   );
> ) >script && . ./script
> 
> Signed-off-by: Mauro Carvalho Chehab <mche...@osg.samsung.com>
> ---
>  Documentation/video4linux/omap4_camera.txt| 2 +-
>  Documentation/video4linux/si4713.txt  | 2 +-
>  MAINTAINERS   | 1 +
>  arch/arm/mach-omap1/include/mach/camera.h | 2 +-
>  arch/arm/mach-omap2/board-rx51-peripherals.c  | 4 ++--
>  arch/arm/plat-samsung/devs.c  | 2 +-
>  arch/sh/boards/mach-ap325rxa/setup.c  | 2 +-
>  drivers/media/platform/marvell-ccic/mmp-driver.c  | 2 +-
>  drivers/media/platform/s5p-tv/hdmi_drv.c  | 2 +-
>  drivers/media/platform/s5p-tv/sii9234_drv.c   | 2 +-
>  drivers/media/platform/soc_camera/omap1_camera.c  | 2 +-
>  drivers/media/platform/soc_camera/soc_camera_platform.c   | 2 +-
>  drivers/media/platform/timblogiw.c| 2 +-
>  drivers/media/radio/radio-timb.c          | 2 +-
>  drivers/media/radio/si4713/radio-usb-si4713.c | 2 +-
>  drivers/media/radio/si4713/si4713.h   | 2 +-
>  drivers/media/rc/gpio-ir-recv.c   | 2 +-
>  drivers/media/rc/ir-rx51.c| 2 +-
>  drivers/mfd/timberdale.c  | 4 ++--

Acked-by: Lee Jones <lee.jo...@linaro.org>
  
>  drivers/staging/media/omap4iss/iss.h  | 2 +-
>  drivers/staging/media/omap4iss/iss_csiphy.h   | 2 +-
>  include/{ => linux/platform_data}/media/gpio-ir-recv.h| 1 -
>  include/{ => linux/platform_data}/media/ir-rx51.h | 0
>  include/{ => linux/platform_data}/media/mmp-camera.h  | 0
>  include/{ => linux/platform_data}/media/omap1_camera.h| 0
>  include/{ => linux/platform_data}/media/omap4iss.h| 0
>  include/{ => linux/platform_data}/media/s5p_hdmi.h| 1 -
>  include/{ => linux/platform_data}/media/si4713.h  | 2 +-
>  include/{ => linux/platform_data}/media/sii9234.h | 0
>  include/{ => linux/platform_data}/media/soc_camera_platform.h | 0
>  include/{ => linux/platform_data}/media/timb_radio.h  | 0
>  include/{ => linux/platform_data}/media/timb_video.h

Re: [PATCH v2 1/3] iio:adc: add iio driver for Palmas (twl6035/7) gpadc

2015-10-13 Thread Lee Jones
On Sun, 11 Oct 2015, Jonathan Cameron wrote:

> On 05/10/15 07:14, H. Nikolaus Schaller wrote:
> > This driver code was found as:
> > 
> > https://android.googlesource.com/kernel/tegra/+/aaabb2e045f31e5a970109ffdaae900dd403d17e/drivers/staging/iio/adc
> > 
> > Fixed various compilation issues and test this driver on omap5 evm.
> > 
> > Signed-off-by: Pradeep Goudagunta <pgoudagu...@nvidia.com>
> > Signed-off-by: H. Nikolaus Schaller <h...@goldelico.com>
> > Signed-off-by: Marek Belisko <ma...@goldelico.com>
> 
> I'm pretty much fine with this.  However, there are some edits within the
> existing mfd support so I will want acks for that or for the driver to go
> through the MFD tree (note that as it touched that, even if only a header,
> Lee and Samuel should have been cc'd).
> 
> One thing that slightly confuses me is there seems to be hints of support in 
> the
> mfd driver already... I can't find any sign of the child device however so
> I guess this is fine from that point of view.
> 
> Reviewed-by: Jonathan Cameron <ji...@kernel.org>
> > ---
> >  drivers/iio/adc/Kconfig|   9 +
> >  drivers/iio/adc/Makefile   |   1 +
> >  drivers/iio/adc/palmas_gpadc.c | 818 
> > +
> >  include/linux/mfd/palmas.h |  75 ++--

Acked-by: Lee Jones <lee.jo...@linaro.org>

> >  4 files changed, 879 insertions(+), 24 deletions(-)
> >  create mode 100644 drivers/iio/adc/palmas_gpadc.c
> > 
> > diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> > index eb0cd89..05a0368 100644
> > --- a/drivers/iio/adc/Kconfig
> > +++ b/drivers/iio/adc/Kconfig
> > @@ -242,6 +242,15 @@ config NAU7802
> >   To compile this driver as a module, choose M here: the
> >   module will be called nau7802.
> >  
> > +config PALMAS_GPADC
> > +   tristate "TI Palmas General Purpose ADC"
> > +   depends on MFD_PALMAS
> > +   help
> > + Say yes here to build support for Texas Instruments Palmas.
> > +
> > + Palmas series pmic chip (twl6035/6037) is used in smartphones and
> > + tablets and supports a 16 channel general purpose ADC.
> > +
> >  config QCOM_SPMI_IADC
> > tristate "Qualcomm SPMI PMIC current ADC"
> > depends on SPMI
> > diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile
> > index a096210..716f112 100644
> > --- a/drivers/iio/adc/Makefile
> > +++ b/drivers/iio/adc/Makefile
> > @@ -26,6 +26,7 @@ obj-$(CONFIG_MCP320X) += mcp320x.o
> >  obj-$(CONFIG_MCP3422) += mcp3422.o
> >  obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.o
> >  obj-$(CONFIG_NAU7802) += nau7802.o
> > +obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o
> >  obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o
> >  obj-$(CONFIG_QCOM_SPMI_VADC) += qcom-spmi-vadc.o
> >  obj-$(CONFIG_ROCKCHIP_SARADC) += rockchip_saradc.o
> > diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c
> > new file mode 100644
> > index 000..6805d81
> > --- /dev/null
> > +++ b/drivers/iio/adc/palmas_gpadc.c
> > @@ -0,0 +1,818 @@
> > +/*
> > + * palmas-adc.c -- TI PALMAS GPADC.
> > + *
> > + * Copyright (c) 2013, NVIDIA Corporation. All rights reserved.
> > + *
> > + * Author: Pradeep Goudagunta <pgoudagu...@nvidia.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 version 2.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#define MOD_NAME "palmas-gpadc"
> > +#define PALMAS_ADC_CONVERSION_TIMEOUT  (msecs_to_jiffies(5000))
> > +#define PALMAS_TO_BE_CALCULATED 0
> > +#define PALMAS_GPADC_TRIMINVALID   -1
> > +
> > +struct palmas_gpadc_info {
> > +/* calibration codes and regs */
> > +   int x1; /* lower ideal code */
> > +   int x2; /* higher ideal code */
> > +   int v1; /* expected lower volt reading */
> > +   int v2; /* expected higher volt reading */
> > +   u8 trim1_reg;   /* register number for lower trim */
> > +   u8 trim2_reg;   /* register number for upper trim */
> > +   int gain;   /* calculated from above (after reading trim regs) */
> > 

Re: [PATCH 3/3] mfd: Add battery charger as subdevice to the tps65217.

2015-09-19 Thread Lee Jones
On Tue, 08 Sep 2015, Enric Balletbo i Serra wrote:

> Add tps65217 battery charger subdevice.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balle...@collabora.com>
> ---
>  drivers/mfd/tps65217.c | 4 
>  1 file changed, 4 insertions(+)

Applied, thanks.

> diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
> index 55add04..d32b5442 100644
> --- a/drivers/mfd/tps65217.c
> +++ b/drivers/mfd/tps65217.c
> @@ -39,6 +39,10 @@ static const struct mfd_cell tps65217s[] = {
>   .name = "tps65217-bl",
>   .of_compatible = "ti,tps65217-bl",
>   },
> + {
> + .name = "tps65217-charger",
> +     .of_compatible = "ti,tps65217-charger",
> + },
>  };
>  
>  /**

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] mfd: twl6040: Fix deferred probe handling for clk32k

2015-09-19 Thread Lee Jones
On Fri, 18 Sep 2015, Tony Lindgren wrote:

> Commit 68bab8662f49 ("mfd: twl6040: Optional clk32k clock handling")
> added clock handling for the 32k clock from palmas-clk. However, that
> patch did not consider a typical situation where twl6040 is built-in,
> and palmas-clk is a loadable module like we have in omap2plus_defconfig.
> 
> If palmas-clk is not loaded before twl6040 probes, we will get a
> "clk32k is not handled" warning during booting. This means that any
> drivers relying on this clock will mysteriously fail, including
> omap5-uevm WLAN and audio.
> 
> Note that for WLAN, we probably should also eventually get
> the clk32kgaudio for MMC3 directly as that's shared between
> audio and WLAN SDIO at least for omap5-uevm. It seems the
> WLAN chip cannot get it as otherwise MMC3 won't get properly
> probed.
> 
> Fixes: 68bab8662f49 ("mfd: twl6040: Optional clk32k clock handling")
> Cc: Benoit Cousson <bcous...@baylibre.com>
> Cc: Dr. H. Nikolaus Schaller <h...@goldelico.com>
> Cc: Grazvydas Ignotas <nota...@gmail.com>
> Cc: Lee Jones <lee.jo...@linaro.org>
> Cc: Peter Ujfalusi <peter.ujfal...@ti.com>
> Cc: Samuel Ortiz <sa...@linux.intel.com>
> Cc: Sourav Poddar <sourav.pod...@ti.com>
> Signed-off-by: Tony Lindgren <t...@atomide.com>
> ---
>  drivers/mfd/twl6040.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks.

> --- a/drivers/mfd/twl6040.c
> +++ b/drivers/mfd/twl6040.c
> @@ -647,6 +647,8 @@ static int twl6040_probe(struct i2c_client *client,
>  
>   twl6040->clk32k = devm_clk_get(>dev, "clk32k");
>   if (IS_ERR(twl6040->clk32k)) {
> + if (PTR_ERR(twl6040->clk32k) == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
>   dev_info(>dev, "clk32k is not handled\n");
>   twl6040->clk32k = NULL;
>   }

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 16/27] mfd: Export OF module alias information in missing drivers

2015-08-10 Thread Lee Jones
On Thu, 30 Jul 2015, Javier Martinez Canillas wrote:

 The I2C core always reports the MODALIAS uevent as i2c:client name
 regardless if the driver was matched using the I2C id_table or the
 of_match_table. So technically there's no need for a driver to export
 the OF table since currently it's not used.
 
 In fact, the I2C device ID table is mandatory for I2C drivers since
 a i2c_device_id is passed to the driver's probe function even if the
 I2C core used the OF table to match the driver.
 
 And since the I2C core uses different tables, OF-only drivers needs to
 have duplicated data that has to be kept in sync and also the dev node
 compatible manufacturer prefix is stripped when reporting the MODALIAS.
 
 To avoid the above, the I2C core behavior may be changed in the future
 to not require an I2C device table for OF-only drivers and report the
 OF module alias. So, it's better to also export the OF table to prevent
 breaking module autoloading if that happens.
 
 Signed-off-by: Javier Martinez Canillas jav...@osg.samsung.com
 
 ---
 
  drivers/mfd/rt5033.c   | 1 +
  drivers/mfd/tps65217.c | 1 +
  drivers/mfd/tps65218.c | 1 +
  3 files changed, 3 insertions(+)

Applied, thanks.

 diff --git a/drivers/mfd/rt5033.c b/drivers/mfd/rt5033.c
 index db395a6c52bc..d60f91619c4a 100644
 --- a/drivers/mfd/rt5033.c
 +++ b/drivers/mfd/rt5033.c
 @@ -124,6 +124,7 @@ static const struct of_device_id rt5033_dt_match[] = {
   { .compatible = richtek,rt5033, },
   { }
  };
 +MODULE_DEVICE_TABLE(of, rt5033_dt_match);
  
  static struct i2c_driver rt5033_driver = {
   .driver = {
 diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
 index bc455feb42be..55add0453ae9 100644
 --- a/drivers/mfd/tps65217.c
 +++ b/drivers/mfd/tps65217.c
 @@ -156,6 +156,7 @@ static const struct of_device_id tps65217_of_match[] = {
   { .compatible = ti,tps65217, .data = (void *)TPS65217 },
   { /* sentinel */ },
  };
 +MODULE_DEVICE_TABLE(of, tps65217_of_match);
  
  static int tps65217_probe(struct i2c_client *client,
   const struct i2c_device_id *ids)
 diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c
 index cb38d725250f..80b9dc363cd8 100644
 --- a/drivers/mfd/tps65218.c
 +++ b/drivers/mfd/tps65218.c
 @@ -211,6 +211,7 @@ static const struct of_device_id 
 of_tps65218_match_table[] = {
   { .compatible = ti,tps65218, },
   {}
  };
 +MODULE_DEVICE_TABLE(of, of_tps65218_match_table);
  
  static int tps65218_probe(struct i2c_client *client,
   const struct i2c_device_id *ids)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 1/2] extcon: palmas: Support GPIO based USB ID detection

2015-08-10 Thread Lee Jones
On Mon, 03 Aug 2015, Roger Quadros wrote:

 Some palmas based chip variants do not have OTG based ID logic.
 For these variants we rely on GPIO based USB ID detection.
 
 These chips do have VBUS comparator for VBUS detection so we
 continue to use the old way of detecting VBUS.
 
 Acked-by: Chanwoo Choi cw00.c...@samsung.com
 Signed-off-by: Roger Quadros rog...@ti.com
 ---
 v4: updated gpio debounce logic to use delayed_workqueue.
 
  .../devicetree/bindings/extcon/extcon-palmas.txt   |   5 +-
  drivers/extcon/extcon-palmas.c | 129 
 ++---
  drivers/extcon/extcon-usb-gpio.c   |   1 +
  include/linux/mfd/palmas.h |   7 ++
  4 files changed, 126 insertions(+), 16 deletions(-)

Acked-by: Lee Jones lee.jo...@linaro.org

 diff --git a/Documentation/devicetree/bindings/extcon/extcon-palmas.txt 
 b/Documentation/devicetree/bindings/extcon/extcon-palmas.txt
 index 45414bb..f61d5af 100644
 --- a/Documentation/devicetree/bindings/extcon/extcon-palmas.txt
 +++ b/Documentation/devicetree/bindings/extcon/extcon-palmas.txt
 @@ -10,8 +10,11 @@ Required Properties:
  
  Optional Properties:
   - ti,wakeup : To enable the wakeup comparator in probe
 - - ti,enable-id-detection: Perform ID detection.
 + - ti,enable-id-detection: Perform ID detection. If id-gpio is specified
 + it performs id-detection using GPIO else using OTG core.
   - ti,enable-vbus-detection: Perform VBUS detection.
 + - id-gpio: gpio for GPIO ID detection. See gpio binding.
 + - debounce-delay-ms: debounce delay for GPIO ID pin in milliseconds.
  
  palmas-usb {
 compatible = ti,twl6035-usb, ti,palmas-usb;
 diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c
 index 8933e7e..662e917 100644
 --- a/drivers/extcon/extcon-palmas.c
 +++ b/drivers/extcon/extcon-palmas.c
 @@ -28,6 +28,10 @@
  #include linux/mfd/palmas.h
  #include linux/of.h
  #include linux/of_platform.h
 +#include linux/of_gpio.h
 +#include linux/workqueue.h
 +
 +#define USB_GPIO_DEBOUNCE_MS 20  /* ms */
  
  static const unsigned int palmas_extcon_cable[] = {
   EXTCON_USB,
 @@ -118,19 +122,54 @@ static irqreturn_t palmas_id_irq_handler(int irq, void 
 *_palmas_usb)
   return IRQ_HANDLED;
  }
  
 +static void palmas_gpio_id_detect(struct work_struct *work)
 +{
 + int id;
 + struct palmas_usb *palmas_usb = container_of(to_delayed_work(work),
 +  struct palmas_usb,
 +  wq_detectid);
 + struct extcon_dev *edev = palmas_usb-edev;
 +
 + if (!palmas_usb-id_gpiod)
 + return;
 +
 + id = gpiod_get_value_cansleep(palmas_usb-id_gpiod);
 +
 + if (id) {
 + extcon_set_cable_state_(edev, EXTCON_USB_HOST, false);
 + dev_info(palmas_usb-dev, USB-HOST cable is detached\n);
 + } else {
 + extcon_set_cable_state_(edev, EXTCON_USB_HOST, true);
 + dev_info(palmas_usb-dev, USB-HOST cable is attached\n);
 + }
 +}
 +
 +static irqreturn_t palmas_gpio_id_irq_handler(int irq, void *_palmas_usb)
 +{
 + struct palmas_usb *palmas_usb = _palmas_usb;
 +
 + queue_delayed_work(system_power_efficient_wq, palmas_usb-wq_detectid,
 +palmas_usb-sw_debounce_jiffies);
 +
 + return IRQ_HANDLED;
 +}
 +
  static void palmas_enable_irq(struct palmas_usb *palmas_usb)
  {
   palmas_write(palmas_usb-palmas, PALMAS_USB_OTG_BASE,
   PALMAS_USB_VBUS_CTRL_SET,
   PALMAS_USB_VBUS_CTRL_SET_VBUS_ACT_COMP);
  
 - palmas_write(palmas_usb-palmas, PALMAS_USB_OTG_BASE,
 - PALMAS_USB_ID_CTRL_SET, PALMAS_USB_ID_CTRL_SET_ID_ACT_COMP);
 + if (palmas_usb-enable_id_detection) {
 + palmas_write(palmas_usb-palmas, PALMAS_USB_OTG_BASE,
 +  PALMAS_USB_ID_CTRL_SET,
 +  PALMAS_USB_ID_CTRL_SET_ID_ACT_COMP);
  
 - palmas_write(palmas_usb-palmas, PALMAS_USB_OTG_BASE,
 - PALMAS_USB_ID_INT_EN_HI_SET,
 - PALMAS_USB_ID_INT_EN_HI_SET_ID_GND |
 - PALMAS_USB_ID_INT_EN_HI_SET_ID_FLOAT);
 + palmas_write(palmas_usb-palmas, PALMAS_USB_OTG_BASE,
 +  PALMAS_USB_ID_INT_EN_HI_SET,
 +  PALMAS_USB_ID_INT_EN_HI_SET_ID_GND |
 +  PALMAS_USB_ID_INT_EN_HI_SET_ID_FLOAT);
 + }
  
   if (palmas_usb-enable_vbus_detection)
   palmas_vbus_irq_handler(palmas_usb-vbus_irq, palmas_usb);
 @@ -169,20 +208,36 @@ static int palmas_usb_probe(struct platform_device 
 *pdev)
   palmas_usb-wakeup = pdata-wakeup;
   }
  
 + palmas_usb-id_gpiod = devm_gpiod_get_optional(pdev-dev, id);
 + if (IS_ERR(palmas_usb-id_gpiod)) {
 + dev_err(pdev-dev, failed to get id gpio\n);
 + return PTR_ERR(palmas_usb-id_gpiod);
 + }
 +
 + if (palmas_usb

Re: [PATCH v3] mfd: kill off set_irq_flags usage

2015-07-27 Thread Lee Jones
On Mon, 27 Jul 2015, Rob Herring wrote:

 set_irq_flags is ARM specific with custom flags which have genirq
 equivalents. Convert drivers to use the genirq interfaces directly, so we
 can kill off set_irq_flags. The translation of flags is as follows:
 
 IRQF_VALID - !IRQ_NOREQUEST
 IRQF_PROBE - !IRQ_NOPROBE
 IRQF_NOAUTOEN - IRQ_NOAUTOEN
 
 For IRQs managed by an irqdomain, the irqdomain core code handles clearing
 and setting IRQ_NOREQUEST already, so there is no need to do this in
 .map() functions and we can simply remove the set_irq_flags calls. Some
 users also modify IRQ_NOPROBE and this has been maintained although it
 is not clear that is really needed. There appears to be a great deal of
 blind copy and paste of this code.
 
 Signed-off-by: Rob Herring r...@kernel.org
 Cc: Samuel Ortiz sa...@linux.intel.com
 Acked-by: Lee Jones lee.jo...@linaro.org
 Acked-by: Linus Walleij linus.wall...@linaro.org
 Cc: Milo Kim milo@ti.com
 Cc: Kumar Gala ga...@codeaurora.org
 Cc: Andy Gross agr...@codeaurora.org
 Cc: David Brown dav...@codeaurora.org
 Cc: Tony Lindgren t...@atomide.com
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: patc...@opensource.wolfsonmicro.com
 Cc: linux-arm-...@vger.kernel.org
 Cc: linux-...@vger.kernel.org
 Cc: linux-omap@vger.kernel.org
 ---
 Thomas asked that this be merged thru subsystem trees instead of arm-soc,
 so please apply this to your tree.
 
 Rob
 
  drivers/mfd/88pm860x-core.c |  4 
  drivers/mfd/ab8500-core.c   |  4 
  drivers/mfd/arizona-irq.c   |  7 ---
  drivers/mfd/asic3.c |  4 ++--
  drivers/mfd/db8500-prcmu.c  |  1 -
  drivers/mfd/ezx-pcap.c  |  6 +-
  drivers/mfd/htc-egpio.c |  4 ++--
  drivers/mfd/htc-i2cpld.c|  6 +-
  drivers/mfd/lp8788-irq.c|  5 -
  drivers/mfd/max8925-core.c  |  5 +
  drivers/mfd/max8997-irq.c   |  5 +
  drivers/mfd/max8998-irq.c   |  5 +
  drivers/mfd/mt6397-core.c   |  4 
  drivers/mfd/pm8921-core.c   |  5 +
  drivers/mfd/rc5t583-irq.c   |  4 +---
  drivers/mfd/stmpe.c |  7 ---
  drivers/mfd/t7l66xb.c   |  6 --
  drivers/mfd/tc3589x.c   |  7 ---
  drivers/mfd/tc6393xb.c  |  4 ++--
  drivers/mfd/tps6586x.c  |  7 ---
  drivers/mfd/tps65912-irq.c  |  8 +---
  drivers/mfd/twl4030-irq.c   | 11 +--
  drivers/mfd/twl6030-irq.c   | 13 -
  drivers/mfd/ucb1x00-core.c  |  2 +-
  drivers/mfd/wm831x-irq.c|  7 ---
  drivers/mfd/wm8350-irq.c|  8 +---
  drivers/mfd/wm8994-irq.c|  7 ---
  27 files changed, 17 insertions(+), 139 deletions(-)

Applied, thanks.

 diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
 index e03b7f4..bc0f3c0 100644
 --- a/drivers/mfd/88pm860x-core.c
 +++ b/drivers/mfd/88pm860x-core.c
 @@ -558,11 +558,7 @@ static int pm860x_irq_domain_map(struct irq_domain *d, 
 unsigned int virq,
   irq_set_chip_data(virq, d-host_data);
   irq_set_chip_and_handler(virq, pm860x_irq_chip, handle_edge_irq);
   irq_set_nested_thread(virq, 1);
 -#ifdef CONFIG_ARM
 - set_irq_flags(virq, IRQF_VALID);
 -#else
   irq_set_noprobe(virq);
 -#endif
   return 0;
  }
 
 diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
 index 000da72..fefbe4c 100644
 --- a/drivers/mfd/ab8500-core.c
 +++ b/drivers/mfd/ab8500-core.c
 @@ -565,11 +565,7 @@ static int ab8500_irq_map(struct irq_domain *d, unsigned 
 int virq,
   irq_set_chip_and_handler(virq, ab8500_irq_chip,
   handle_simple_irq);
   irq_set_nested_thread(virq, 1);
 -#ifdef CONFIG_ARM
 - set_irq_flags(virq, IRQF_VALID);
 -#else
   irq_set_noprobe(virq);
 -#endif
 
   return 0;
  }
 diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
 index 2b9965d5..7d66aec 100644
 --- a/drivers/mfd/arizona-irq.c
 +++ b/drivers/mfd/arizona-irq.c
 @@ -174,14 +174,7 @@ static int arizona_irq_map(struct irq_domain *h, 
 unsigned int virq,
   irq_set_chip_data(virq, data);
   irq_set_chip_and_handler(virq, arizona_irq_chip, handle_simple_irq);
   irq_set_nested_thread(virq, 1);
 -
 - /* ARM needs us to explicitly flag the IRQ as valid
 -  * and will set them noprobe when we do so. */
 -#ifdef CONFIG_ARM
 - set_irq_flags(virq, IRQF_VALID);
 -#else
   irq_set_noprobe(virq);
 -#endif
 
   return 0;
  }
 diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
 index 120df5c..4b54128 100644
 --- a/drivers/mfd/asic3.c
 +++ b/drivers/mfd/asic3.c
 @@ -411,7 +411,7 @@ static int __init asic3_irq_probe(struct platform_device 
 *pdev)
 
   irq_set_chip_data(irq, asic);
   irq_set_handler(irq, handle_level_irq);
 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
   }
 
   asic3_write_register(asic, ASIC3_OFFSET(INTR, INT_MASK),
 @@ -431,7 +431,7 @@ static void asic3_irq_remove(struct platform_device *pdev)
   irq_base = asic

Re: [PATCH] mfd: Drop owner assignment from i2c_drivers

2015-07-10 Thread Lee Jones
= wm8400_i2c_probe,
   .remove   = wm8400_i2c_remove,
 diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
 index 53ae5af5d6e4..213da3416778 100644
 --- a/drivers/mfd/wm8994-core.c
 +++ b/drivers/mfd/wm8994-core.c
 @@ -677,7 +677,6 @@ static const struct dev_pm_ops wm8994_pm_ops = {
  static struct i2c_driver wm8994_i2c_driver = {
   .driver = {
   .name = wm8994,
 - .owner = THIS_MODULE,
   .pm = wm8994_pm_ops,
   .of_match_table = of_match_ptr(wm8994_of_match),
   },

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09/15] mfd: kill off set_irq_flags usage

2015-06-11 Thread Lee Jones
On Tue, 09 Jun 2015, Rob Herring wrote:

 set_irq_flags is ARM specific with custom flags which have genirq
 equivalents. Convert drivers to use the genirq interfaces directly, so we
 can kill off set_irq_flags. The translation of flags is as follows:
 
 IRQF_VALID - !IRQ_NOREQUEST
 IRQF_PROBE - !IRQ_NOPROBE
 IRQF_NOAUTOEN - IRQ_NOAUTOEN
 
 For IRQs managed by an irqdomain, the irqdomain core code handles clearing
 and setting IRQ_NOREQUEST already, so there is no need to do this in
 .map() functions and we can simply remove the set_irq_flags calls. Some
 users also set IRQ_NOPROBE and this has been maintained although it is not
 clear that is really needed. There appears to be a great deal of blind
 copy and paste of this code.
 
 Signed-off-by: Rob Herring r...@kernel.org
 Cc: Samuel Ortiz sa...@linux.intel.com
 Cc: Lee Jones lee.jo...@linaro.org
 Cc: Linus Walleij linus.wall...@linaro.org
 Cc: Milo Kim milo@ti.com
 Cc: Kumar Gala ga...@codeaurora.org
 Cc: Andy Gross agr...@codeaurora.org
 Cc: David Brown dav...@codeaurora.org
 Cc: Tony Lindgren t...@atomide.com
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: patc...@opensource.wolfsonmicro.com
 Cc: linux-arm-...@vger.kernel.org
 Cc: linux-...@vger.kernel.org
 Cc: linux-omap@vger.kernel.org
 ---
  drivers/mfd/88pm860x-core.c |  4 
  drivers/mfd/ab8500-core.c   |  4 
  drivers/mfd/arizona-irq.c   |  7 ---
  drivers/mfd/asic3.c |  4 ++--
  drivers/mfd/db8500-prcmu.c  |  1 -
  drivers/mfd/ezx-pcap.c  |  6 +-
  drivers/mfd/htc-egpio.c |  4 ++--
  drivers/mfd/htc-i2cpld.c|  6 +-
  drivers/mfd/lp8788-irq.c|  5 -
  drivers/mfd/max8925-core.c  |  5 +
  drivers/mfd/max8997-irq.c   |  5 +
  drivers/mfd/max8998-irq.c   |  5 +
  drivers/mfd/mt6397-core.c   |  4 
  drivers/mfd/pm8921-core.c   |  5 +
  drivers/mfd/rc5t583-irq.c   |  4 +---
  drivers/mfd/stmpe.c |  7 ---
  drivers/mfd/t7l66xb.c   |  6 --
  drivers/mfd/tc3589x.c   |  7 ---
  drivers/mfd/tc6393xb.c  |  4 ++--
  drivers/mfd/tps6586x.c  |  7 ---
  drivers/mfd/tps65912-irq.c  |  8 +---
  drivers/mfd/twl4030-irq.c   | 11 +--
  drivers/mfd/twl6030-irq.c   | 13 -
  drivers/mfd/ucb1x00-core.c  |  2 +-
  drivers/mfd/wm831x-irq.c|  7 ---
  drivers/mfd/wm8350-irq.c|  8 +---
  drivers/mfd/wm8994-irq.c|  7 ---
  27 files changed, 17 insertions(+), 139 deletions(-)

Acked-by: Lee Jones lee.jo...@linaro.org

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC v1 08/25] mfd: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc

2015-05-20 Thread Lee Jones
On Wed, 20 May 2015, Jiang Liu wrote:

 Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we
 already have a pointer to corresponding irq_desc.
 
 Do the same thing to avoid pattern irq_get_chip_data(data-irq).
 
 Signed-off-by: Jiang Liu jiang@linux.intel.com
 ---
  drivers/mfd/ezx-pcap.c|2 +-
  drivers/mfd/max8997-irq.c |8 
  drivers/mfd/mt6397-core.c |8 
  drivers/mfd/t7l66xb.c |2 +-
  drivers/mfd/tc6393xb.c|2 +-
  drivers/mfd/twl6030-irq.c |2 +-
  6 files changed, 12 insertions(+), 12 deletions(-)

Again, so long as this has been properly tested:

Acked-by: Lee Jones lee.jo...@linaro.org

 diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c
 index 5991faddd3c6..e5f4ffaa5414 100644
 --- a/drivers/mfd/ezx-pcap.c
 +++ b/drivers/mfd/ezx-pcap.c
 @@ -207,7 +207,7 @@ static void pcap_isr_work(struct work_struct *work)
  
  static void pcap_irq_handler(unsigned int irq, struct irq_desc *desc)
  {
 - struct pcap_chip *pcap = irq_get_handler_data(irq);
 + struct pcap_chip *pcap = irq_desc_get_handler_data(desc);
  
   desc-irq_data.chip-irq_ack(desc-irq_data);
   queue_work(pcap-workqueue, pcap-isr_work);
 diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c
 index 43fa61413e93..381738b477f8 100644
 --- a/drivers/mfd/max8997-irq.c
 +++ b/drivers/mfd/max8997-irq.c
 @@ -113,14 +113,14 @@ static const struct max8997_irq_data max8997_irqs[] = {
  
  static void max8997_irq_lock(struct irq_data *data)
  {
 - struct max8997_dev *max8997 = irq_get_chip_data(data-irq);
 + struct max8997_dev *max8997 = irq_data_get_irq_chip_data(data);
  
   mutex_lock(max8997-irqlock);
  }
  
  static void max8997_irq_sync_unlock(struct irq_data *data)
  {
 - struct max8997_dev *max8997 = irq_get_chip_data(data-irq);
 + struct max8997_dev *max8997 = irq_data_get_irq_chip_data(data);
   int i;
  
   for (i = 0; i  MAX8997_IRQ_GROUP_NR; i++) {
 @@ -148,7 +148,7 @@ irq_to_max8997_irq(struct max8997_dev *max8997, int irq)
  
  static void max8997_irq_mask(struct irq_data *data)
  {
 - struct max8997_dev *max8997 = irq_get_chip_data(data-irq);
 + struct max8997_dev *max8997 = irq_data_get_irq_chip_data(data);
   const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997,
   data-irq);
  
 @@ -157,7 +157,7 @@ static void max8997_irq_mask(struct irq_data *data)
  
  static void max8997_irq_unmask(struct irq_data *data)
  {
 - struct max8997_dev *max8997 = irq_get_chip_data(data-irq);
 + struct max8997_dev *max8997 = irq_data_get_irq_chip_data(data);
   const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997,
   data-irq);
  
 diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
 index 09bc7804952a..dab325b9d0df 100644
 --- a/drivers/mfd/mt6397-core.c
 +++ b/drivers/mfd/mt6397-core.c
 @@ -39,14 +39,14 @@ static const struct mfd_cell mt6397_devs[] = {
  
  static void mt6397_irq_lock(struct irq_data *data)
  {
 - struct mt6397_chip *mt6397 = irq_get_chip_data(data-irq);
 + struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data);
  
   mutex_lock(mt6397-irqlock);
  }
  
  static void mt6397_irq_sync_unlock(struct irq_data *data)
  {
 - struct mt6397_chip *mt6397 = irq_get_chip_data(data-irq);
 + struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data);
  
   regmap_write(mt6397-regmap, MT6397_INT_CON0, mt6397-irq_masks_cur[0]);
   regmap_write(mt6397-regmap, MT6397_INT_CON1, mt6397-irq_masks_cur[1]);
 @@ -56,7 +56,7 @@ static void mt6397_irq_sync_unlock(struct irq_data *data)
  
  static void mt6397_irq_disable(struct irq_data *data)
  {
 - struct mt6397_chip *mt6397 = irq_get_chip_data(data-irq);
 + struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data);
   int shift = data-hwirq  0xf;
   int reg = data-hwirq  4;
  
 @@ -65,7 +65,7 @@ static void mt6397_irq_disable(struct irq_data *data)
  
  static void mt6397_irq_enable(struct irq_data *data)
  {
 - struct mt6397_chip *mt6397 = irq_get_chip_data(data-irq);
 + struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data);
   int shift = data-hwirq  0xf;
   int reg = data-hwirq  4;
  
 diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
 index c09fb5dccd50..b752ca2be549 100644
 --- a/drivers/mfd/t7l66xb.c
 +++ b/drivers/mfd/t7l66xb.c
 @@ -187,7 +187,7 @@ static struct mfd_cell t7l66xb_cells[] = {
  /* Handle the T7L66XB interrupt mux */
  static void t7l66xb_irq(unsigned int irq, struct irq_desc *desc)
  {
 - struct t7l66xb *t7l66xb = irq_get_handler_data(irq);
 + struct t7l66xb *t7l66xb = irq_desc_get_handler_data(desc);
   unsigned int isr;
   unsigned int i, irq_base;
  
 diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
 index 63458b39a97d..d21253a51cff 100644

Re: [PATCH] mfd: Constify regmap and irq configuration data

2015-04-28 Thread Lee Jones
 mt6397_irq_domain_ops = {
 +static const struct irq_domain_ops mt6397_irq_domain_ops = {
   .map = mt6397_irq_domain_map,
  };
  
 diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
 index 2d7fae94c861..18c4d72d1d2a 100644
 --- a/drivers/mfd/stmpe.c
 +++ b/drivers/mfd/stmpe.c
 @@ -989,7 +989,7 @@ static void stmpe_irq_unmap(struct irq_domain *d, 
 unsigned int virq)
   irq_set_chip_data(virq, NULL);
  }
  
 -static struct irq_domain_ops stmpe_irq_ops = {
 +static const struct irq_domain_ops stmpe_irq_ops = {
  .map= stmpe_irq_map,
  .unmap  = stmpe_irq_unmap,
  .xlate  = irq_domain_xlate_twocell,
 diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
 index cf356395c9e9..96d420dfc15d 100644
 --- a/drivers/mfd/tc3589x.c
 +++ b/drivers/mfd/tc3589x.c
 @@ -233,7 +233,7 @@ static void tc3589x_irq_unmap(struct irq_domain *d, 
 unsigned int virq)
   irq_set_chip_data(virq, NULL);
  }
  
 -static struct irq_domain_ops tc3589x_irq_ops = {
 +static const struct irq_domain_ops tc3589x_irq_ops = {
   .map= tc3589x_irq_map,
   .unmap  = tc3589x_irq_unmap,
   .xlate  = irq_domain_xlate_onecell,
 diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
 index 8e1dbc469580..e0a2583916ce 100644
 --- a/drivers/mfd/tps6586x.c
 +++ b/drivers/mfd/tps6586x.c
 @@ -311,7 +311,7 @@ static int tps6586x_irq_map(struct irq_domain *h, 
 unsigned int virq,
   return 0;
  }
  
 -static struct irq_domain_ops tps6586x_domain_ops = {
 +static const struct irq_domain_ops tps6586x_domain_ops = {
   .map= tps6586x_irq_map,
   .xlate  = irq_domain_xlate_twocell,
  };
 diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
 index 2807e1a95663..20fb58179ada 100644
 --- a/drivers/mfd/twl6030-irq.c
 +++ b/drivers/mfd/twl6030-irq.c
 @@ -376,7 +376,7 @@ static void twl6030_irq_unmap(struct irq_domain *d, 
 unsigned int virq)
   irq_set_chip_data(virq, NULL);
  }
  
 -static struct irq_domain_ops twl6030_irq_domain_ops = {
 +static const struct irq_domain_ops twl6030_irq_domain_ops = {
   .map= twl6030_irq_map,
   .unmap  = twl6030_irq_unmap,
   .xlate  = irq_domain_xlate_onetwocell,
 diff --git a/drivers/mfd/wm831x-irq.c b/drivers/mfd/wm831x-irq.c
 index 64e512eadf17..3da81263c764 100644
 --- a/drivers/mfd/wm831x-irq.c
 +++ b/drivers/mfd/wm831x-irq.c
 @@ -564,7 +564,7 @@ static int wm831x_irq_map(struct irq_domain *h, unsigned 
 int virq,
   return 0;
  }
  
 -static struct irq_domain_ops wm831x_irq_domain_ops = {
 +static const struct irq_domain_ops wm831x_irq_domain_ops = {
   .map= wm831x_irq_map,
   .xlate  = irq_domain_xlate_twocell,
  };
 diff --git a/drivers/mfd/wm8994-irq.c b/drivers/mfd/wm8994-irq.c
 index a14407edbd89..55c380a67686 100644
 --- a/drivers/mfd/wm8994-irq.c
 +++ b/drivers/mfd/wm8994-irq.c
 @@ -28,7 +28,7 @@
  
  #include linux/delay.h
  
 -static struct regmap_irq wm8994_irqs[] = {
 +static const struct regmap_irq wm8994_irqs[] = {
   [WM8994_IRQ_TEMP_SHUT] = {
   .reg_offset = 1,
   .mask = WM8994_TEMP_SHUT_EINT,
 @@ -128,7 +128,7 @@ static struct regmap_irq wm8994_irqs[] = {
   },
  };
  
 -static struct regmap_irq_chip wm8994_irq_chip = {
 +static const struct regmap_irq_chip wm8994_irq_chip = {
   .name = wm8994,
   .irqs = wm8994_irqs,
   .num_irqs = ARRAY_SIZE(wm8994_irqs),
 @@ -184,7 +184,7 @@ static int wm8994_edge_irq_map(struct irq_domain *h, 
 unsigned int virq,
   return 0;
  }
  
 -static struct irq_domain_ops wm8994_edge_irq_ops = {
 +static const struct irq_domain_ops wm8994_edge_irq_ops = {
   .map= wm8994_edge_irq_map,
   .xlate  = irq_domain_xlate_twocell,
  };
 diff --git a/include/linux/mfd/da9055/core.h b/include/linux/mfd/da9055/core.h
 index 956afa445998..5dc743fd63a6 100644
 --- a/include/linux/mfd/da9055/core.h
 +++ b/include/linux/mfd/da9055/core.h
 @@ -89,6 +89,6 @@ static inline int da9055_reg_update(struct da9055 *da9055, 
 unsigned char reg,
  int da9055_device_init(struct da9055 *da9055);
  void da9055_device_exit(struct da9055 *da9055);
  
 -extern struct regmap_config da9055_regmap_config;
 +extern const struct regmap_config da9055_regmap_config;
  
  #endif /* __DA9055_CORE_H */

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] mfd: menelaus: use macro for magic number

2015-03-30 Thread Lee Jones
On Sat, 28 Mar 2015, Aaro Koskinen wrote:

 Use macro to check a register bit.
 
 Signed-off-by: Aaro Koskinen aaro.koski...@iki.fi
 ---
  drivers/mfd/menelaus.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

 diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
 index 917fa86..c2ca665 100644
 --- a/drivers/mfd/menelaus.c
 +++ b/drivers/mfd/menelaus.c
 @@ -1216,7 +1216,7 @@ static int menelaus_probe(struct i2c_client *client,
   err = menelaus_read_reg(MENELAUS_VCORE_CTRL1);
   if (err  0)
   goto fail;
 - if (err  BIT(7))
 + if (err  VCORE_CTRL1_HW_NSW)
   menelaus-vcore_hw_mode = 1;
   else
   menelaus-vcore_hw_mode = 0;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] mfd: menelaus: drop support for SW controller VCORE

2015-03-30 Thread Lee Jones
On Sat, 28 Mar 2015, Aaro Koskinen wrote:

 Drop support for SW controlled VCORE, nobody uses it.
 
 Signed-off-by: Aaro Koskinen aaro.koski...@iki.fi
 ---
  drivers/mfd/menelaus.c   | 23 ---
  include/linux/mfd/menelaus.h |  1 -
  2 files changed, 24 deletions(-)

Applied, thanks.

 diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
 index 9f01aef..917fa86 100644
 --- a/drivers/mfd/menelaus.c
 +++ b/drivers/mfd/menelaus.c
 @@ -532,29 +532,6 @@ static const struct menelaus_vtg_value vcore_values[] = {
   { 1450, 18 },
  };
  
 -int menelaus_set_vcore_sw(unsigned int mV)
 -{
 - int val, ret;
 - struct i2c_client *c = the_menelaus-client;
 -
 - val = menelaus_get_vtg_value(mV, vcore_values,
 -  ARRAY_SIZE(vcore_values));
 - if (val  0)
 - return -EINVAL;
 -
 - dev_dbg(c-dev, Setting VCORE to %d mV (val 0x%02x)\n, mV, val);
 -
 - /* Set SW mode and the voltage in one go. */
 - mutex_lock(the_menelaus-lock);
 - ret = menelaus_write_reg(MENELAUS_VCORE_CTRL1, val);
 - if (ret == 0)
 - the_menelaus-vcore_hw_mode = 0;
 - mutex_unlock(the_menelaus-lock);
 - msleep(1);
 -
 - return ret;
 -}
 -
  int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV)
  {
   int fval, rval, val, ret;
 diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
 index a1e12bf3..9e85ac0 100644
 --- a/include/linux/mfd/menelaus.h
 +++ b/include/linux/mfd/menelaus.h
 @@ -24,7 +24,6 @@ extern int menelaus_set_vaux(unsigned int mV);
  extern int menelaus_set_vdcdc(int dcdc, unsigned int mV);
  extern int menelaus_set_slot_sel(int enable);
  extern int menelaus_get_slot_pin_states(void);
 -extern int menelaus_set_vcore_sw(unsigned int mV);
  extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int 
 floor_mV);
  
  #define EN_VPLL_SLEEP(1  7)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] mfd: menelaus: delete omap_has_menelaus

2015-03-30 Thread Lee Jones
On Sat, 28 Mar 2015, Aaro Koskinen wrote:

 Delete unused macro.
 
 Signed-off-by: Aaro Koskinen aaro.koski...@iki.fi
 ---
  include/linux/mfd/menelaus.h | 6 --
  1 file changed, 6 deletions(-)

Applied, thanks.

 diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
 index f097e89..a1e12bf3 100644
 --- a/include/linux/mfd/menelaus.h
 +++ b/include/linux/mfd/menelaus.h
 @@ -38,10 +38,4 @@ extern int menelaus_set_vcore_hw(unsigned int roof_mV, 
 unsigned int floor_mV);
  
  extern int menelaus_set_regulator_sleep(int enable, u32 val);
  
 -#if defined(CONFIG_ARCH_OMAP2)  defined(CONFIG_MENELAUS)
 -#define omap_has_menelaus()  1
 -#else
 -#define omap_has_menelaus()  0
 -#endif
 -
  #endif

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: twl6040: Remove wrong and unneeded platform:twl6040 modalias

2015-03-30 Thread Lee Jones
On Mon, 30 Mar 2015, Axel Lin wrote:

 This is a I2C driver, so it's wrong to use platform prefix for the
 modalias. We have all needed i2c aliases coming form MODULE_DEVICE_TABLE,
 so let's remove the wrong and unneeded platform:twl6040 modalias.
 
 Signed-off-by: Axel Lin axel@ingics.com
 ---
  drivers/mfd/twl6040.c | 1 -
  1 file changed, 1 deletion(-)

Applied, thanks.

 diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c
 index f71ee3d..c5265c1 100644
 --- a/drivers/mfd/twl6040.c
 +++ b/drivers/mfd/twl6040.c
 @@ -814,4 +814,3 @@ MODULE_DESCRIPTION(TWL6040 MFD);
  MODULE_AUTHOR(Misael Lopez Cruz misael.lo...@ti.com);
  MODULE_AUTHOR(Jorge Eduardo Candelaria jorge.candela...@ti.com);
  MODULE_LICENSE(GPL);
 -MODULE_ALIAS(platform:twl6040);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 21/35 linux-next] mfd: constify of_device_id array

2015-03-23 Thread Lee Jones
On Mon, 16 Mar 2015, Fabian Frederick wrote:

 of_device_id is always used as const.
 (See driver.of_match_table and open firmware functions)
 
 Signed-off-by: Fabian Frederick f...@skynet.be
 ---
  drivers/mfd/hi6421-pmic-core.c | 2 +-
  drivers/mfd/rk808.c| 2 +-
  drivers/mfd/twl4030-power.c| 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

 diff --git a/drivers/mfd/hi6421-pmic-core.c b/drivers/mfd/hi6421-pmic-core.c
 index 7210ae2..95b2ff8 100644
 --- a/drivers/mfd/hi6421-pmic-core.c
 +++ b/drivers/mfd/hi6421-pmic-core.c
 @@ -93,7 +93,7 @@ static int hi6421_pmic_remove(struct platform_device *pdev)
   return 0;
  }
  
 -static struct of_device_id of_hi6421_pmic_match_tbl[] = {
 +static const struct of_device_id of_hi6421_pmic_match_tbl[] = {
   { .compatible = hisilicon,hi6421-pmic, },
   { },
  };
 diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
 index 7cf25c7..4b1e439 100644
 --- a/drivers/mfd/rk808.c
 +++ b/drivers/mfd/rk808.c
 @@ -246,7 +246,7 @@ static int rk808_remove(struct i2c_client *client)
   return 0;
  }
  
 -static struct of_device_id rk808_of_match[] = {
 +static const struct of_device_id rk808_of_match[] = {
   { .compatible = rockchip,rk808 },
   { },
  };
 diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
 index 3935092..f440aed 100644
 --- a/drivers/mfd/twl4030-power.c
 +++ b/drivers/mfd/twl4030-power.c
 @@ -829,7 +829,7 @@ static struct twl4030_power_data osc_off_idle = {
   .board_config   = osc_off_rconfig,
  };
  
 -static struct of_device_id twl4030_power_of_match[] = {
 +static const struct of_device_id twl4030_power_of_match[] = {
   {
   .compatible = ti,twl4030-power,
   },

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: menelaus: rmove incorrect __exit markups

2015-03-10 Thread Lee Jones
On Mon, 09 Mar 2015, Dmitry Torokhov wrote:

 Even if bus is not hot-pluggable, the devices can be unbound from the
 driver via sysfs, so we should not be using __exit annotations on
 remove() methods. The only exception is drivers registered with
 platform_driver_probe() which specifically disables sysfs bind/unbind
 attributes.
 
 Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com
 ---
  drivers/mfd/menelaus.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

 diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
 index 9f01aef..5269ff2 100644
 --- a/drivers/mfd/menelaus.c
 +++ b/drivers/mfd/menelaus.c
 @@ -1259,7 +1259,7 @@ fail:
   return err;
  }
  
 -static int __exit menelaus_remove(struct i2c_client *client)
 +static int menelaus_remove(struct i2c_client *client)
  {
   struct menelaus_chip*menelaus = i2c_get_clientdata(client);
  
 @@ -1280,7 +1280,7 @@ static struct i2c_driver menelaus_i2c_driver = {
   .name   = DRIVER_NAME,
   },
   .probe  = menelaus_probe,
 - .remove = __exit_p(menelaus_remove),
 + .remove = menelaus_remove,
   .id_table   = menelaus_id,
  };
  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 3/6] mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save

2015-02-24 Thread Lee Jones
On Wed, 07 Jan 2015, Vignesh R wrote:

 In one shot mode, sequencer automatically disables all enabled steps at
 the end of each cycle. (both ADC steps and TSC steps) Hence these steps
 need not be saved in reg_se_cache for clearing these steps at a later
 stage.
 Also, when ADC wakes up Sequencer should not be busy executing any of the
 config steps except for the charge step. Previously charge step was 1 ADC
 clock cycle and hence it was ignored.
 TSC steps are always disabled at the end of each conversion cycle, hence
 there is no need to explicitly disable TSC steps by writing 0 to REG_SE.
 
 Signed-off-by: Vignesh R vigne...@ti.com
 ---
 
 v5:
  - Remove unnecessary clearing of REG_SE
 
  drivers/mfd/ti_am335x_tscadc.c   | 13 +
  include/linux/mfd/ti_am335x_tscadc.h |  1 +
  2 files changed, 6 insertions(+), 8 deletions(-)

Applied, thanks.

 diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
 index 467c80e1c4ae..e4e4b22eebc9 100644
 --- a/drivers/mfd/ti_am335x_tscadc.c
 +++ b/drivers/mfd/ti_am335x_tscadc.c
 @@ -68,12 +68,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
   DEFINE_WAIT(wait);
   u32 reg;
  
 - /*
 -  * disable TSC steps so it does not run while the ADC is using it. If
 -  * write 0 while it is running (it just started or was already running)
 -  * then it completes all steps that were enabled and stops then.
 -  */
 - tscadc_writel(tsadc, REG_SE, 0);
   reg = tscadc_readl(tsadc, REG_ADCFSM);
   if (reg  SEQ_STATUS) {
   tsadc-adc_waiting = true;
 @@ -86,8 +80,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
   spin_lock_irq(tsadc-reg_lock);
   finish_wait(tsadc-reg_se_wait, wait);
  
 + /*
 +  * Sequencer should either be idle or
 +  * busy applying the charge step.
 +  */
   reg = tscadc_readl(tsadc, REG_ADCFSM);
 - WARN_ON(reg  SEQ_STATUS);
 + WARN_ON((reg  SEQ_STATUS)  !(reg  CHARGE_STEP));
   tsadc-adc_waiting = false;
   }
   tsadc-adc_in_use = true;
 @@ -96,7 +94,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
  void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
  {
   spin_lock_irq(tsadc-reg_lock);
 - tsadc-reg_se_cache |= val;
   am335x_tscadc_need_adc(tsadc);
  
   tscadc_writel(tsadc, REG_SE, val);
 diff --git a/include/linux/mfd/ti_am335x_tscadc.h 
 b/include/linux/mfd/ti_am335x_tscadc.h
 index 3f4e994ace2b..1fd50dcfe47c 100644
 --- a/include/linux/mfd/ti_am335x_tscadc.h
 +++ b/include/linux/mfd/ti_am335x_tscadc.h
 @@ -128,6 +128,7 @@
  
  /* Sequencer Status */
  #define SEQ_STATUS BIT(5)
 +#define CHARGE_STEP  0x11
  
  #define ADC_CLK  300
  #define TOTAL_STEPS  16

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 04/15] twl4030_charger: use runtime_pm to keep usb phy active while charging.

2015-02-24 Thread Lee Jones
On Tue, 24 Feb 2015, NeilBrown wrote:

 The twl4030 usb phy needs to be active while we are using
 the USB VBUS as a current source for charging.
 In particular, the usb3v1 regulator must be enabled and the
 PHY_PWR_PHYPWD bit must be set to keep the phy powered.
 
 commit ab37813f4093a5f59cb8e083cde277289dc72ed3
 twl4030_charger: Allow charger to control the regulator that feeds it
 
 Gave the charger control over the regulator, but didn't resolve
 the PHY_PWR_PHYPWD issue.
 
 Now that both of these are controlled by runtime_pm in
 phy-twl4030-usb, we can simply take a runtime_pm reference to the USB
 phy whenever the charger wants to use it as a current source.
 
 So this patch reverts the above commit, and adds the necessary
 runtime_pm calls.
 
 Signed-off-by: NeilBrown ne...@suse.de
 ---
  drivers/mfd/twl-core.c  |9 -

Acked-by: Lee Jones lee.jo...@linaro.org

  drivers/power/twl4030_charger.c |   18 +-
  2 files changed, 9 insertions(+), 18 deletions(-)
 
 diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
 index 489674a2497e..831696ee2472 100644
 --- a/drivers/mfd/twl-core.c
 +++ b/drivers/mfd/twl-core.c
 @@ -788,9 +788,8 @@ add_children(struct twl4030_platform_data *pdata, 
 unsigned irq_base,
   static struct regulator_consumer_supply usb1v8 = {
   .supply =   usb1v8,
   };
 - static struct regulator_consumer_supply usb3v1[] = {
 - { .supply = usb3v1 },
 - { .supply = bci3v1 },
 + static struct regulator_consumer_supply usb3v1 = {
 + .supply =   usb3v1,
   };
  
   /* First add the regulators so that they can be used by transceiver */
 @@ -818,7 +817,7 @@ add_children(struct twl4030_platform_data *pdata, 
 unsigned irq_base,
   return PTR_ERR(child);
  
   child = add_regulator_linked(TWL4030_REG_VUSB3V1,
 -   usb_fixed, usb3v1, 2,
 +   usb_fixed, usb3v1, 1,
 features);
   if (IS_ERR(child))
   return PTR_ERR(child);
 @@ -838,7 +837,7 @@ add_children(struct twl4030_platform_data *pdata, 
 unsigned irq_base,
   if (IS_ENABLED(CONFIG_REGULATOR_TWL4030)  child) {
   usb1v5.dev_name = dev_name(child);
   usb1v8.dev_name = dev_name(child);
 - usb3v1[0].dev_name = dev_name(child);
 + usb3v1.dev_name = dev_name(child);
   }
   }
  
 diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
 index 51321f0c5548..11f352a5ef55 100644
 --- a/drivers/power/twl4030_charger.c
 +++ b/drivers/power/twl4030_charger.c
 @@ -22,7 +22,6 @@
  #include linux/power_supply.h
  #include linux/notifier.h
  #include linux/usb/otg.h
 -#include linux/regulator/machine.h
  
  #define TWL4030_BCIMSTATEC   0x02
  #define TWL4030_BCIICHG  0x08
 @@ -94,7 +93,6 @@ struct twl4030_bci {
   struct work_struct  work;
   int irq_chg;
   int irq_bci;
 - struct regulator*usb_reg;
   int usb_enabled;
  
   unsigned long   event;
 @@ -208,7 +206,7 @@ static int twl4030_charger_enable_usb(struct twl4030_bci 
 *bci, bool enable)
  {
   int ret;
  
 - if (enable) {
 + if (enable  !IS_ERR_OR_NULL(bci-transceiver)) {
   /* Check for USB charger connected */
   if (!twl4030_bci_have_vbus(bci))
   return -ENODEV;
 @@ -222,14 +220,9 @@ static int twl4030_charger_enable_usb(struct twl4030_bci 
 *bci, bool enable)
   return -EACCES;
   }
  
 - /* Need to keep regulator on */
 + /* Need to keep phy powered */
   if (!bci-usb_enabled) {
 - ret = regulator_enable(bci-usb_reg);
 - if (ret) {
 - dev_err(bci-dev,
 - Failed to enable regulator\n);
 - return ret;
 - }
 + pm_runtime_get_sync(bci-transceiver-dev);
   bci-usb_enabled = 1;
   }
  
 @@ -244,7 +237,8 @@ static int twl4030_charger_enable_usb(struct twl4030_bci 
 *bci, bool enable)
   } else {
   ret = twl4030_clear_set_boot_bci(TWL4030_BCIAUTOUSB, 0);
   if (bci-usb_enabled) {
 - regulator_disable(bci-usb_reg);
 + pm_runtime_mark_last_busy(bci-transceiver-dev);
 + pm_runtime_put_autosuspend(bci-transceiver-dev);
   bci-usb_enabled = 0;
   }
   }
 @@ -602,8 +596,6

Re: [PATCH 13/14] mfd: twl-core: Constify struct regmap_config and reg_default array

2015-01-20 Thread Lee Jones
On Mon, 05 Jan 2015, Krzysztof Kozlowski wrote:

 The regmap_config struct may be const because it is not modified by the
 driver and regmap_init() accepts pointer to const. Make array of
 struct reg_default const as well.
 
 Signed-off-by: Krzysztof Kozlowski k.kozlow...@samsung.com
 Cc: Tony Lindgren t...@atomide.com
 Cc: linux-omap@vger.kernel.org
 ---
  drivers/mfd/twl-core.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

Applied with Tony's Ack, thanks.

 diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
 index db11b4f40611..489674a2497e 100644
 --- a/drivers/mfd/twl-core.c
 +++ b/drivers/mfd/twl-core.c
 @@ -207,7 +207,7 @@ static struct twl_mapping twl4030_map[] = {
   { 2, TWL5031_BASEADD_INTERRUPTS },
  };
  
 -static struct reg_default twl4030_49_defaults[] = {
 +static const struct reg_default twl4030_49_defaults[] = {
   /* Audio Registers */
   { 0x01, 0x00}, /* CODEC_MODE*/
   { 0x02, 0x00}, /* OPTION*/
 @@ -306,7 +306,7 @@ static const struct regmap_access_table 
 twl4030_49_volatile_table = {
   .n_yes_ranges = ARRAY_SIZE(twl4030_49_volatile_ranges),
  };
  
 -static struct regmap_config twl4030_regmap_config[4] = {
 +static const struct regmap_config twl4030_regmap_config[4] = {
   {
   /* Address 0x48 */
   .reg_bits = 8,
 @@ -369,7 +369,7 @@ static struct twl_mapping twl6030_map[] = {
   { 1, TWL6030_BASEADD_GASGAUGE },
  };
  
 -static struct regmap_config twl6030_regmap_config[3] = {
 +static const struct regmap_config twl6030_regmap_config[3] = {
   {
   /* Address 0x48 */
   .reg_bits = 8,
 @@ -1087,7 +1087,7 @@ twl_probe(struct i2c_client *client, const struct 
 i2c_device_id *id)
   struct twl4030_platform_data*pdata = dev_get_platdata(client-dev);
   struct device_node  *node = client-dev.of_node;
   struct platform_device  *pdev;
 - struct regmap_config*twl_regmap_config;
 + const struct regmap_config  *twl_regmap_config;
   int irq_base = 0;
   int status;
   unsignedi, num_slaves;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 14/14] mfd: twl6040: Constify struct regmap_config and reg_default array

2015-01-20 Thread Lee Jones
On Mon, 05 Jan 2015, Krzysztof Kozlowski wrote:

 The regmap_config struct may be const because it is not modified by the
 driver and regmap_init() accepts pointer to const. Make array of
 struct reg_default const as well.
 
 Signed-off-by: Krzysztof Kozlowski k.kozlow...@samsung.com
 Cc: Tony Lindgren t...@atomide.com
 Cc: linux-omap@vger.kernel.org
 ---
  drivers/mfd/twl6040.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Applied with Tony's Ack, thanks.

 diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c
 index 9687645162ae..f71ee3dbc2a2 100644
 --- a/drivers/mfd/twl6040.c
 +++ b/drivers/mfd/twl6040.c
 @@ -44,7 +44,7 @@
  #define VIBRACTRL_MEMBER(reg) ((reg == TWL6040_REG_VIBCTLL) ? 0 : 1)
  #define TWL6040_NUM_SUPPLIES (2)
  
 -static struct reg_default twl6040_defaults[] = {
 +static const struct reg_default twl6040_defaults[] = {
   { 0x01, 0x4B }, /* REG_ASICID   (ro) */
   { 0x02, 0x00 }, /* REG_ASICREV  (ro) */
   { 0x03, 0x00 }, /* REG_INTID*/
 @@ -580,7 +580,7 @@ static bool twl6040_writeable_reg(struct device *dev, 
 unsigned int reg)
   }
  }
  
 -static struct regmap_config twl6040_regmap_config = {
 +static const struct regmap_config twl6040_regmap_config = {
   .reg_bits = 8,
   .val_bits = 8,
  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 3/6] mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save

2015-01-20 Thread Lee Jones
On Wed, 07 Jan 2015, Vignesh R wrote:

 In one shot mode, sequencer automatically disables all enabled steps at
 the end of each cycle. (both ADC steps and TSC steps) Hence these steps
 need not be saved in reg_se_cache for clearing these steps at a later
 stage.
 Also, when ADC wakes up Sequencer should not be busy executing any of the
 config steps except for the charge step. Previously charge step was 1 ADC
 clock cycle and hence it was ignored.
 TSC steps are always disabled at the end of each conversion cycle, hence
 there is no need to explicitly disable TSC steps by writing 0 to REG_SE.
 
 Signed-off-by: Vignesh R vigne...@ti.com
 ---
 
 v5:
  - Remove unnecessary clearing of REG_SE
 
  drivers/mfd/ti_am335x_tscadc.c   | 13 +
  include/linux/mfd/ti_am335x_tscadc.h |  1 +
  2 files changed, 6 insertions(+), 8 deletions(-)

Looks fine.

For my own reference:
  Acked-by: Lee Jones lee.jo...@linaro.org

Can this patch be applied on its own?

 diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
 index 467c80e1c4ae..e4e4b22eebc9 100644
 --- a/drivers/mfd/ti_am335x_tscadc.c
 +++ b/drivers/mfd/ti_am335x_tscadc.c
 @@ -68,12 +68,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
   DEFINE_WAIT(wait);
   u32 reg;
  
 - /*
 -  * disable TSC steps so it does not run while the ADC is using it. If
 -  * write 0 while it is running (it just started or was already running)
 -  * then it completes all steps that were enabled and stops then.
 -  */
 - tscadc_writel(tsadc, REG_SE, 0);
   reg = tscadc_readl(tsadc, REG_ADCFSM);
   if (reg  SEQ_STATUS) {
   tsadc-adc_waiting = true;
 @@ -86,8 +80,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
   spin_lock_irq(tsadc-reg_lock);
   finish_wait(tsadc-reg_se_wait, wait);
  
 + /*
 +  * Sequencer should either be idle or
 +  * busy applying the charge step.
 +  */
   reg = tscadc_readl(tsadc, REG_ADCFSM);
 - WARN_ON(reg  SEQ_STATUS);
 + WARN_ON((reg  SEQ_STATUS)  !(reg  CHARGE_STEP));
   tsadc-adc_waiting = false;
   }
   tsadc-adc_in_use = true;
 @@ -96,7 +94,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
  void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
  {
   spin_lock_irq(tsadc-reg_lock);
 - tsadc-reg_se_cache |= val;
   am335x_tscadc_need_adc(tsadc);
  
   tscadc_writel(tsadc, REG_SE, val);
 diff --git a/include/linux/mfd/ti_am335x_tscadc.h 
 b/include/linux/mfd/ti_am335x_tscadc.h
 index 3f4e994ace2b..1fd50dcfe47c 100644
 --- a/include/linux/mfd/ti_am335x_tscadc.h
 +++ b/include/linux/mfd/ti_am335x_tscadc.h
 @@ -128,6 +128,7 @@
  
  /* Sequencer Status */
  #define SEQ_STATUS BIT(5)
 +#define CHARGE_STEP  0x11
  
  #define ADC_CLK  300
  #define TOTAL_STEPS  16

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 12/14] mfd: tps65218: Constify struct regmap_config

2015-01-20 Thread Lee Jones
On Mon, 05 Jan 2015, Krzysztof Kozlowski wrote:

 The regmap_config struct may be const because it is not modified by the
 driver and regmap_init() accepts pointer to const.
 
 Signed-off-by: Krzysztof Kozlowski k.kozlow...@samsung.com
 Cc: Tony Lindgren t...@atomide.com
 Cc: linux-omap@vger.kernel.org
 ---
  drivers/mfd/tps65218.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied with Tony's Ack, thanks.

 diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c
 index 0d256cb002eb..b019b3198afe 100644
 --- a/drivers/mfd/tps65218.c
 +++ b/drivers/mfd/tps65218.c
 @@ -125,7 +125,7 @@ int tps65218_clear_bits(struct tps65218 *tps, unsigned 
 int reg,
  }
  EXPORT_SYMBOL_GPL(tps65218_clear_bits);
  
 -static struct regmap_config tps65218_regmap_config = {
 +static const struct regmap_config tps65218_regmap_config = {
   .reg_bits = 8,
   .val_bits = 8,
   .cache_type = REGCACHE_RBTREE,

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 11/14] mfd: tps65217: Constify struct regmap_config

2015-01-20 Thread Lee Jones
On Mon, 05 Jan 2015, Krzysztof Kozlowski wrote:

 The regmap_config struct may be const because it is not modified by the
 driver and regmap_init() accepts pointer to const.
 
 Signed-off-by: Krzysztof Kozlowski k.kozlow...@samsung.com
 Cc: Tony Lindgren t...@atomide.com
 Cc: linux-omap@vger.kernel.org
 ---
  drivers/mfd/tps65217.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied with Tony's Ack, thanks.

 diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
 index 80a919a8ca97..7d1cfc1d3ce0 100644
 --- a/drivers/mfd/tps65217.c
 +++ b/drivers/mfd/tps65217.c
 @@ -145,7 +145,7 @@ int tps65217_clear_bits(struct tps65217 *tps, unsigned 
 int reg,
  }
  EXPORT_SYMBOL_GPL(tps65217_clear_bits);
  
 -static struct regmap_config tps65217_regmap_config = {
 +static const struct regmap_config tps65217_regmap_config = {
   .reg_bits = 8,
   .val_bits = 8,
  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/7] mfd: menelaus: make vcore and regulator controls internal

2015-01-20 Thread Lee Jones
On Sat, 27 Dec 2014, Aaro Koskinen wrote:

 Make vcore and regulator control functions internal to the driver.
 
 Signed-off-by: Aaro Koskinen aaro.koski...@iki.fi
 ---
  drivers/mfd/menelaus.c   | 13 +++--
  include/linux/mfd/menelaus.h | 12 
  2 files changed, 11 insertions(+), 14 deletions(-)
 
 diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
 index 4a900cc..8660adf 100644
 --- a/drivers/mfd/menelaus.c
 +++ b/drivers/mfd/menelaus.c
 @@ -163,6 +163,15 @@
  #define MCT_PIN_ST_S1_CD_ST  (1  0)
  #define MCT_PIN_ST_S2_CD_ST  (1  1)
  
 +#define EN_VPLL_SLEEP(1  7)
 +#define EN_VMMC_SLEEP(1  6)
 +#define EN_VAUX_SLEEP(1  5)
 +#define EN_VIO_SLEEP (1  4)
 +#define EN_VMEM_SLEEP(1  3)
 +#define EN_DC3_SLEEP (1  2)
 +#define EN_DC2_SLEEP (1  1)
 +#define EN_VC_SLEEP  (1  0)

Better to use the BIT() macro for this kind of stuff.

Please take this opportunity to use it.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] mfd: menelaus: delete omap_has_menelaus

2015-01-20 Thread Lee Jones
On Sat, 27 Dec 2014, Aaro Koskinen wrote:

 Delete unused macro.
 
 Signed-off-by: Aaro Koskinen aaro.koski...@iki.fi
 ---
  include/linux/mfd/menelaus.h | 6 --
  1 file changed, 6 deletions(-)

Applied, thanks.

 diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
 index f097e89..a1e12bf3 100644
 --- a/include/linux/mfd/menelaus.h
 +++ b/include/linux/mfd/menelaus.h
 @@ -38,10 +38,4 @@ extern int menelaus_set_vcore_hw(unsigned int roof_mV, 
 unsigned int floor_mV);
  
  extern int menelaus_set_regulator_sleep(int enable, u32 val);
  
 -#if defined(CONFIG_ARCH_OMAP2)  defined(CONFIG_MENELAUS)
 -#define omap_has_menelaus()  1
 -#else
 -#define omap_has_menelaus()  0
 -#endif
 -
  #endif

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/7] mfd: menelaus: drop support for SW controller VCORE

2015-01-20 Thread Lee Jones
On Sat, 27 Dec 2014, Aaro Koskinen wrote:

 Drop support for SW controlled VCORE, nobody uses it.
 
 Signed-off-by: Aaro Koskinen aaro.koski...@iki.fi
 ---
  drivers/mfd/menelaus.c   | 23 ---
  include/linux/mfd/menelaus.h |  1 -
  2 files changed, 24 deletions(-)

Applied, thanks.

 diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
 index 9f01aef..917fa86 100644
 --- a/drivers/mfd/menelaus.c
 +++ b/drivers/mfd/menelaus.c
 @@ -532,29 +532,6 @@ static const struct menelaus_vtg_value vcore_values[] = {
   { 1450, 18 },
  };
  
 -int menelaus_set_vcore_sw(unsigned int mV)
 -{
 - int val, ret;
 - struct i2c_client *c = the_menelaus-client;
 -
 - val = menelaus_get_vtg_value(mV, vcore_values,
 -  ARRAY_SIZE(vcore_values));
 - if (val  0)
 - return -EINVAL;
 -
 - dev_dbg(c-dev, Setting VCORE to %d mV (val 0x%02x)\n, mV, val);
 -
 - /* Set SW mode and the voltage in one go. */
 - mutex_lock(the_menelaus-lock);
 - ret = menelaus_write_reg(MENELAUS_VCORE_CTRL1, val);
 - if (ret == 0)
 - the_menelaus-vcore_hw_mode = 0;
 - mutex_unlock(the_menelaus-lock);
 - msleep(1);
 -
 - return ret;
 -}
 -
  int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV)
  {
   int fval, rval, val, ret;
 diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
 index a1e12bf3..9e85ac0 100644
 --- a/include/linux/mfd/menelaus.h
 +++ b/include/linux/mfd/menelaus.h
 @@ -24,7 +24,6 @@ extern int menelaus_set_vaux(unsigned int mV);
  extern int menelaus_set_vdcdc(int dcdc, unsigned int mV);
  extern int menelaus_set_slot_sel(int enable);
  extern int menelaus_get_slot_pin_states(void);
 -extern int menelaus_set_vcore_sw(unsigned int mV);
  extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int 
 floor_mV);
  
  #define EN_VPLL_SLEEP(1  7)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/7] mfd: menelaus: delete platform data support

2015-01-20 Thread Lee Jones
On Sat, 27 Dec 2014, Aaro Koskinen wrote:

 Delete platform data support.
 
 Signed-off-by: Aaro Koskinen aaro.koski...@iki.fi
 ---
  arch/arm/mach-omap2/common-board-devices.h |  2 --
  drivers/mfd/menelaus.c | 10 +-
  include/linux/mfd/menelaus.h   |  6 --
  3 files changed, 1 insertion(+), 17 deletions(-)

Applied, thanks.

 diff --git a/arch/arm/mach-omap2/common-board-devices.h 
 b/arch/arm/mach-omap2/common-board-devices.h
 index 07c88ae..7a30228 100644
 --- a/arch/arm/mach-omap2/common-board-devices.h
 +++ b/arch/arm/mach-omap2/common-board-devices.h
 @@ -2,7 +2,6 @@
  #define __OMAP_COMMON_BOARD_DEVICES__
  
  #include sound/tlv320aic3x.h
 -#include linux/mfd/menelaus.h
  #include twl-common.h
  
  #define NAND_BLOCK_SIZE  SZ_128K
 @@ -14,7 +13,6 @@ void omap_ads7846_init(int bus_num, int gpio_pendown, int 
 gpio_debounce,
  struct ads7846_platform_data *board_pdata);
  void *n8x0_legacy_init(void);
  
 -extern struct menelaus_platform_data n8x0_menelaus_platform_data;
  extern struct aic3x_pdata n810_aic33_data;
  
  #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
 diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
 index 3e04c64..4a900cc 100644
 --- a/drivers/mfd/menelaus.c
 +++ b/drivers/mfd/menelaus.c
 @@ -1181,8 +1181,6 @@ static int menelaus_probe(struct i2c_client *client,
   int rev = 0;
   int err = 0;
   struct device_node  *np = client-dev.of_node;
 - struct menelaus_platform_data *menelaus_pdata =
 - dev_get_platdata(client-dev);
  
   if (the_menelaus) {
   dev_dbg(client-dev, only one %s for now\n,
 @@ -1240,13 +1238,7 @@ static int menelaus_probe(struct i2c_client *client,
   else
   menelaus-vcore_hw_mode = 0;
  
 - if (menelaus_pdata != NULL) {
 - if (menelaus_pdata-late_init != NULL) {
 - err = menelaus_pdata-late_init(client-dev);
 - if (err  0)
 - goto fail;
 - }
 - } else if (np) {
 + if (np) {
   u32 vcore_min;
   u32 vcore_max;
  
 diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
 index 9e85ac0..21eeff5 100644
 --- a/include/linux/mfd/menelaus.h
 +++ b/include/linux/mfd/menelaus.h
 @@ -5,12 +5,6 @@
  #ifndef __ASM_ARCH_MENELAUS_H
  #define __ASM_ARCH_MENELAUS_H
  
 -struct device;
 -
 -struct menelaus_platform_data {
 - int (* late_init)(struct device *dev);
 -};
 -
  extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 
 card_mask),
 void *data);
  extern void menelaus_unregister_mmc_callback(void);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/7] mfd: menelaus: make vcore and regulator controls internal

2015-01-20 Thread Lee Jones
On Tue, 20 Jan 2015, Lee Jones wrote:

 On Sat, 27 Dec 2014, Aaro Koskinen wrote:
 
  Make vcore and regulator control functions internal to the driver.
  
  Signed-off-by: Aaro Koskinen aaro.koski...@iki.fi
  ---
   drivers/mfd/menelaus.c   | 13 +++--
   include/linux/mfd/menelaus.h | 12 
   2 files changed, 11 insertions(+), 14 deletions(-)
  
  diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
  index 4a900cc..8660adf 100644
  --- a/drivers/mfd/menelaus.c
  +++ b/drivers/mfd/menelaus.c
  @@ -163,6 +163,15 @@
   #define MCT_PIN_ST_S1_CD_ST(1  0)
   #define MCT_PIN_ST_S2_CD_ST(1  1)
   
  +#define EN_VPLL_SLEEP  (1  7)
  +#define EN_VMMC_SLEEP  (1  6)
  +#define EN_VAUX_SLEEP  (1  5)
  +#define EN_VIO_SLEEP   (1  4)
  +#define EN_VMEM_SLEEP  (1  3)
  +#define EN_DC3_SLEEP   (1  2)
  +#define EN_DC2_SLEEP   (1  1)
  +#define EN_VC_SLEEP(1  0)
 
 Better to use the BIT() macro for this kind of stuff.
 
 Please take this opportunity to use it.

In fact, nevermind.  I'll do it from here.

Applied, thanks.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/7] mfd: menelaus: use macro for magic number

2015-01-20 Thread Lee Jones
On Sat, 27 Dec 2014, Aaro Koskinen wrote:

 Use macro to check a register bit.
 
 Signed-off-by: Aaro Koskinen aaro.koski...@iki.fi
 ---
  drivers/mfd/menelaus.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

 diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
 index 8660adf..05bae40 100644
 --- a/drivers/mfd/menelaus.c
 +++ b/drivers/mfd/menelaus.c
 @@ -1242,7 +1242,7 @@ static int menelaus_probe(struct i2c_client *client,
   err = menelaus_read_reg(MENELAUS_VCORE_CTRL1);
   if (err  0)
   goto fail;
 - if (err  BIT(7))
 + if (err  VCORE_CTRL1_HW_NSW)
   menelaus-vcore_hw_mode = 1;
   else
   menelaus-vcore_hw_mode = 0;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/7] Menelaus cleanup for DT, phase 1

2015-01-20 Thread Lee Jones
On Sat, 27 Dec 2014, Aaro Koskinen wrote:
 These patches start removal of board-specific callbacks from Menelaus:
 delete platform data and a callback from the driver to the board files.
 
 Tested on top of 3.19-rc1 on N800/N810 which are the only in-tree users
 for the driver.
 
 Aaro Koskinen (7):
   mfd: menelaus: delete omap_has_menelaus
   mfd: menelaus: drop support for SW controller VCORE
   mfd: menelaus: add initial DT support
   ARM: OMAP: N8x0: configure menelaus using DT
   mfd: menelaus: delete platform data support
   mfd: menelaus: make vcore and regulator controls internal
   mfd: menelaus: use macro for magic number
 
  Documentation/devicetree/bindings/mfd/menelaus.txt | 30 
  arch/arm/boot/dts/omap2420-n8x0-common.dtsi|  3 +
  arch/arm/mach-omap2/board-n8x0.c   | 57 --
  arch/arm/mach-omap2/common-board-devices.h |  2 -
  arch/arm/mach-omap2/pdata-quirks.c |  1 -
  drivers/mfd/menelaus.c | 86 
 ++
  include/linux/mfd/menelaus.h   | 25 ---
  7 files changed, 87 insertions(+), 117 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/mfd/menelaus.txt

Scrap that.  Looks like I can't apply the other patches without
03/07.  Please sort this out with Felipe and re-submit.  Don't forget
to apply my Ack to the patches I said I applied.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 3/6] mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save

2015-01-20 Thread Lee Jones
On Tue, 20 Jan 2015, R, Vignesh wrote:
 On 1/20/2015 5:23 PM, Lee Jones wrote:
  On Wed, 07 Jan 2015, Vignesh R wrote:
  
  In one shot mode, sequencer automatically disables all enabled steps at
  the end of each cycle. (both ADC steps and TSC steps) Hence these steps
  need not be saved in reg_se_cache for clearing these steps at a later
  stage.
  Also, when ADC wakes up Sequencer should not be busy executing any of the
  config steps except for the charge step. Previously charge step was 1 ADC
  clock cycle and hence it was ignored.
  TSC steps are always disabled at the end of each conversion cycle, hence
  there is no need to explicitly disable TSC steps by writing 0 to REG_SE.
 
  Signed-off-by: Vignesh R vigne...@ti.com
  ---
 
  v5:
   - Remove unnecessary clearing of REG_SE
 
   drivers/mfd/ti_am335x_tscadc.c   | 13 +
   include/linux/mfd/ti_am335x_tscadc.h |  1 +
   2 files changed, 6 insertions(+), 8 deletions(-)
  
  Looks fine.
  
  For my own reference:
Acked-by: Lee Jones lee.jo...@linaro.org
  
  Can this patch be applied on its own?
  
 
 I prefer to wait until input patches are picked up.

I have no problem with that, but is there a technical reason why?

  diff --git a/drivers/mfd/ti_am335x_tscadc.c 
  b/drivers/mfd/ti_am335x_tscadc.c
  index 467c80e1c4ae..e4e4b22eebc9 100644
  --- a/drivers/mfd/ti_am335x_tscadc.c
  +++ b/drivers/mfd/ti_am335x_tscadc.c
  @@ -68,12 +68,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
  *tsadc)
 DEFINE_WAIT(wait);
 u32 reg;
   
  -  /*
  -   * disable TSC steps so it does not run while the ADC is using it. If
  -   * write 0 while it is running (it just started or was already running)
  -   * then it completes all steps that were enabled and stops then.
  -   */
  -  tscadc_writel(tsadc, REG_SE, 0);
 reg = tscadc_readl(tsadc, REG_ADCFSM);
 if (reg  SEQ_STATUS) {
 tsadc-adc_waiting = true;
  @@ -86,8 +80,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
  *tsadc)
 spin_lock_irq(tsadc-reg_lock);
 finish_wait(tsadc-reg_se_wait, wait);
   
  +  /*
  +   * Sequencer should either be idle or
  +   * busy applying the charge step.
  +   */
 reg = tscadc_readl(tsadc, REG_ADCFSM);
  -  WARN_ON(reg  SEQ_STATUS);
  +  WARN_ON((reg  SEQ_STATUS)  !(reg  CHARGE_STEP));
 tsadc-adc_waiting = false;
 }
 tsadc-adc_in_use = true;
  @@ -96,7 +94,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
  *tsadc)
   void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
   {
 spin_lock_irq(tsadc-reg_lock);
  -  tsadc-reg_se_cache |= val;
 am335x_tscadc_need_adc(tsadc);
   
 tscadc_writel(tsadc, REG_SE, val);
  diff --git a/include/linux/mfd/ti_am335x_tscadc.h 
  b/include/linux/mfd/ti_am335x_tscadc.h
  index 3f4e994ace2b..1fd50dcfe47c 100644
  --- a/include/linux/mfd/ti_am335x_tscadc.h
  +++ b/include/linux/mfd/ti_am335x_tscadc.h
  @@ -128,6 +128,7 @@
   
   /* Sequencer Status */
   #define SEQ_STATUS BIT(5)
  +#define CHARGE_STEP   0x11
   
   #define ADC_CLK   300
   #define TOTAL_STEPS   16
  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/5] mfd: tps65218: make INT1 our status_base register

2015-01-18 Thread Lee Jones
On Fri, 26 Dec 2014, Felipe Balbi wrote:

 If we don't tell regmap-irq that our first status
 register is at offset 1, it will try to read offset
 zero, which is the chipid register.
 
 Fixes: 44b4dc6 mfd: tps65218: Add driver for the TPS65218 PMIC
 Cc: sta...@vger.kernel.org # v3.15+
 Cc: Keerthy j-keer...@ti.com
 Cc: Lee Jones lee.jo...@linaro.org
 Signed-off-by: Felipe Balbi ba...@ti.com
 ---
  drivers/mfd/tps65218.c | 1 +
  1 file changed, 1 insertion(+)

Sorry for the delay.  It's difficult to get a WiFi signal 2000m up in
an Austrian mountain. :)

Applied now, thanks.

 diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c
 index 2243f75..d6b7643 100644
 --- a/drivers/mfd/tps65218.c
 +++ b/drivers/mfd/tps65218.c
 @@ -204,6 +204,7 @@ static struct regmap_irq_chip tps65218_irq_chip = {
  
   .num_regs = 2,
   .mask_base = TPS65218_REG_INT_MASK1,
 + .status_base = TPS65218_REG_INT1,
  };
  
  static const struct of_device_id of_tps65218_match_table[] = {

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] mfd: tps65218: make INT[12] and STATUS registers volatile

2015-01-18 Thread Lee Jones
On Fri, 26 Dec 2014, Felipe Balbi wrote:

 STATUS register can be modified by the HW, so we
 should bypass cache because of that.
 
 In the case of INT[12] registers, they are the ones
 that actually clear the IRQ source at the time they
 are read. If we rely on the cache for them, we will
 never be able to clear the interrupt, which will cause
 our IRQ line to be disabled due to IRQ throttling.
 
 Fixes: 44b4dc6 mfd: tps65218: Add driver for the TPS65218 PMIC
 Cc: sta...@vger.kernel.org # v3.15+
 Cc: Keerthy j-keer...@ti.com
 Cc: Lee Jones lee.jo...@linaro.org
 Signed-off-by: Felipe Balbi ba...@ti.com
 ---
  drivers/mfd/tps65218.c | 11 +++
  1 file changed, 11 insertions(+)

Sorry for the delay.  It's difficult to get a WiFi signal 2000m up in
an Austrian mountain. :)

Applied now, thanks.

 diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c
 index 0d256cb..2243f75 100644
 --- a/drivers/mfd/tps65218.c
 +++ b/drivers/mfd/tps65218.c
 @@ -125,10 +125,21 @@ int tps65218_clear_bits(struct tps65218 *tps, unsigned 
 int reg,
  }
  EXPORT_SYMBOL_GPL(tps65218_clear_bits);
  
 +static const struct regmap_range tps65218_yes_ranges[] = {
 + regmap_reg_range(TPS65218_REG_INT1, TPS65218_REG_INT2),
 + regmap_reg_range(TPS65218_REG_STATUS, TPS65218_REG_STATUS),
 +};
 +
 +static const struct regmap_access_table tps65218_volatile_table = {
 + .yes_ranges = tps65218_yes_ranges,
 + .n_yes_ranges = ARRAY_SIZE(tps65218_yes_ranges),
 +};
 +
  static struct regmap_config tps65218_regmap_config = {
   .reg_bits = 8,
   .val_bits = 8,
   .cache_type = REGCACHE_RBTREE,
 + .volatile_table = tps65218_volatile_table,
  };
  
  static const struct regmap_irq tps65218_irqs[] = {

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 3/6] mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save

2014-11-18 Thread Lee Jones
On Fri, 14 Nov 2014, Vignesh R wrote:

 In one shot mode, sequencer automatically disables all enabled steps at
 the end of each cycle. (both ADC steps and TSC steps) Hence these steps
 need not be saved in reg_se_cache for clearing these steps at a later
 stage.
 Also, when ADC wakes up Sequencer should not be busy executing any of the
 config steps except for the charge step. Previously charge step was 1 ADC
 clock cycle and hence it was ignored.
 
 Signed-off-by: Vignesh R vigne...@ti.com
 ---
  drivers/mfd/ti_am335x_tscadc.c   | 7 +--
  include/linux/mfd/ti_am335x_tscadc.h | 1 +
  2 files changed, 6 insertions(+), 2 deletions(-)

Code looks better now.

Acked-by: Lee Jones lee.jo...@linaro.org

What's the plan for this series?

 diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
 index d877e777cce6..110038859a8d 100644
 --- a/drivers/mfd/ti_am335x_tscadc.c
 +++ b/drivers/mfd/ti_am335x_tscadc.c
 @@ -86,8 +86,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
   spin_lock_irq(tsadc-reg_lock);
   finish_wait(tsadc-reg_se_wait, wait);
  
 + /*
 +  * Sequencer should either be idle or
 +  * busy applying the charge step.
 +  */
   reg = tscadc_readl(tsadc, REG_ADCFSM);
 - WARN_ON(reg  SEQ_STATUS);
 + WARN_ON((reg  SEQ_STATUS)  !(reg  CHARGE_STEP));
   tsadc-adc_waiting = false;
   }
   tsadc-adc_in_use = true;
 @@ -96,7 +100,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
  void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
  {
   spin_lock_irq(tsadc-reg_lock);
 - tsadc-reg_se_cache |= val;
   am335x_tscadc_need_adc(tsadc);
  
   tscadc_writel(tsadc, REG_SE, val);
 diff --git a/include/linux/mfd/ti_am335x_tscadc.h 
 b/include/linux/mfd/ti_am335x_tscadc.h
 index 3f4e994ace2b..1fd50dcfe47c 100644
 --- a/include/linux/mfd/ti_am335x_tscadc.h
 +++ b/include/linux/mfd/ti_am335x_tscadc.h
 @@ -128,6 +128,7 @@
  
  /* Sequencer Status */
  #define SEQ_STATUS BIT(5)
 +#define CHARGE_STEP  0x11
  
  #define ADC_CLK  300
  #define TOTAL_STEPS  16

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 3/6] mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save

2014-11-13 Thread Lee Jones
On Tue, 11 Nov 2014, R, Vignesh wrote:
 On Tue, 11 Nov 2014, Vignesh R wrote:
  In one shot mode, sequencer automatically disables all enabled steps 
  at the end of each cycle. (both ADC steps and TSC steps) Hence these 
  steps need not be saved in reg_se_cache for clearing these steps at a 
  later stage.
  Also, when ADC wakes up Sequencer should not be busy executing any of 
  the config steps except for the charge step. Previously charge step 
  was 1 ADC clock cycle and hence it was ignored.
  
  Signed-off-by: Vignesh R vigne...@ti.com
  ---

[...]

  -   tsadc-reg_se_cache |= val;
 
 You didn't answer my question about this?
 I did reply to the question in the previous thread.  
 
 Previously, TSC did not reliably re-enable its steps as the TSC irq handler 
 received 
 false pen up events. Hence, in order to use TSC after ADC operation, it was 
 necessary to
  save and re-enable TSC steps (basically, to keep TSC steps enabled always).
 The change was more of a workaround to overcome limitation of TSC irq 
 handler. With 
 this series of patches, TSC irq handler is very reliable and the workaround 
 is no longer required.

Okay, thanks for the explanation.

By the way, your mailer doesn't appear to quote previous messages.  Is
there any way to fix that?

  am335x_tscadc_need_adc(tsadc);
   
  tscadc_writel(tsadc, REG_SE, val);
  diff --git a/include/linux/mfd/ti_am335x_tscadc.h 
  b/include/linux/mfd/ti_am335x_tscadc.h
  index c99be5dc0f5c..fcce182e4a35 100644
  --- a/include/linux/mfd/ti_am335x_tscadc.h
  +++ b/include/linux/mfd/ti_am335x_tscadc.h
  @@ -128,6 +128,7 @@
   
   /* Sequencer Status */
   #define SEQ_STATUS BIT(5)
  +#define CHARGE_STEP0x11
   
   #define ADC_CLK300
   #define TOTAL_STEPS16
 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 3/6] mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save

2014-11-11 Thread Lee Jones
On Tue, 11 Nov 2014, Vignesh R wrote:

 In one shot mode, sequencer automatically disables all enabled steps at
 the end of each cycle. (both ADC steps and TSC steps) Hence these steps
 need not be saved in reg_se_cache for clearing these steps at a later
 stage.
 Also, when ADC wakes up Sequencer should not be busy executing any of the
 config steps except for the charge step. Previously charge step was 1 ADC
 clock cycle and hence it was ignored.
 
 Signed-off-by: Vignesh R vigne...@ti.com
 ---

You need to provide a changelog here when submitting new versions.

  drivers/mfd/ti_am335x_tscadc.c   | 7 +--
  include/linux/mfd/ti_am335x_tscadc.h | 1 +
  2 files changed, 6 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
 index d877e777cce6..110038859a8d 100644
 --- a/drivers/mfd/ti_am335x_tscadc.c
 +++ b/drivers/mfd/ti_am335x_tscadc.c
 @@ -86,8 +86,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
   spin_lock_irq(tsadc-reg_lock);
   finish_wait(tsadc-reg_se_wait, wait);
  
 + /*
 +  * Sequencer should either be idle or
 +  * busy applying the charge step.
 +  */
   reg = tscadc_readl(tsadc, REG_ADCFSM);
 - WARN_ON(reg  SEQ_STATUS);
 + WARN_ON((reg  SEQ_STATUS)  !(reg  CHARGE_STEP));
   tsadc-adc_waiting = false;
   }
   tsadc-adc_in_use = true;
 @@ -96,7 +100,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
  void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
  {
   spin_lock_irq(tsadc-reg_lock);
 - tsadc-reg_se_cache |= val;

You didn't answer my question about this?

   am335x_tscadc_need_adc(tsadc);
  
   tscadc_writel(tsadc, REG_SE, val);
 diff --git a/include/linux/mfd/ti_am335x_tscadc.h 
 b/include/linux/mfd/ti_am335x_tscadc.h
 index c99be5dc0f5c..fcce182e4a35 100644
 --- a/include/linux/mfd/ti_am335x_tscadc.h
 +++ b/include/linux/mfd/ti_am335x_tscadc.h
 @@ -128,6 +128,7 @@
  
  /* Sequencer Status */
  #define SEQ_STATUS BIT(5)
 +#define CHARGE_STEP  0x11
  
  #define ADC_CLK  300
  #define TOTAL_STEPS  16

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: twl4030-power: Fix poweroff with PM configuration enabled

2014-11-11 Thread Lee Jones
On Mon, 10 Nov 2014, Russell King - ARM Linux wrote:

 On Mon, Nov 10, 2014 at 12:40:19PM +, Lee Jones wrote:
  On Sun, 02 Nov 2014, Tony Lindgren wrote:
  
   Commit e7cd1d1eb16f (mfd: twl4030-power: Add generic reset
   configuration) enabled configuring the PM features for twl4030.
   
   This caused poweroff command to fail on devices that have the
   BCI charger on twl4030 wired, or have power wired for VBUS.
   Instead of powering off, the device reboots. This is because
   voltage is detected on charger or VBUS with the default bits
   enabled for the power transition registers.
   
   To fix the issue, let's just clear VBUS and CHG bits as we want
   poweroff command to keep the system powered off.
   
   Fixes: e7cd1d1eb16f (mfd: twl4030-power: Add generic reset 
   configuration)
   Cc: sta...@vger.kernel.org # v3.16+
   Reported-by: Russell King rmk+ker...@arm.linux.org.uk
   Signed-off-by: Tony Lindgren t...@atomide.com
  
  Applied to -fixes.
  
  Not sure whether that was an Ack from Russell or not?
 
 A Tested-by would've been more appropriate than an ack.

Applied.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/5] input: touchscreen: ti_am335x_tsc: Remove udelay in interrupt handler

2014-11-10 Thread Lee Jones
On Fri, 07 Nov 2014, Vignesh R wrote:

 From: Brad Griffis bgrif...@ti.com
 
 TSC interrupt handler had udelay to avoid reporting of false pen-up
 interrupt to user space. This patch implements workaround suggesting in
 Advisory 1.0.31 of silicon errata for am335x, thus eliminating udelay
 and touchscreen lag. This also improves performance of touchscreen and
 eliminates sudden jump of cursor at touch release.
 
 IDLECONFIG and CHARGECONFIG registers are to be configured
 with same values in order to eliminate false pen-up events. This
 workaround may result in false pen-down to be detected, hence considerable
 charge step delay needs to be added. The charge delay is set to 0xB000
 (in terms of ADC clock cycles) by default.
 
 TSC steps are disabled at the end of every sampling cycle and EOS bit is
 set. Once the EOS bit is set, the TSC steps need to be re-enabled to begin
 next sampling cycle.
 
 Signed-off-by: Brad Griffis bgrif...@ti.com
 [vigne...@ti.com: Ported the patch from v3.12 to v3.18rc2]
 
 Signed-off-by: Vignesh R vigne...@ti.com
 ---
  drivers/input/touchscreen/ti_am335x_tsc.c | 56 
 ---
  include/linux/mfd/ti_am335x_tscadc.h  |  3 +-

Acked-by: Lee Jones lee.jo...@linaro.org

  2 files changed, 24 insertions(+), 35 deletions(-)
 
 diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c 
 b/drivers/input/touchscreen/ti_am335x_tsc.c
 index 1aeac9675fe7..483fd97c0e0c 100644
 --- a/drivers/input/touchscreen/ti_am335x_tsc.c
 +++ b/drivers/input/touchscreen/ti_am335x_tsc.c
 @@ -173,11 +173,9 @@ static void titsc_step_config(struct titsc *ts_dev)
   titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY);
   }
  
 - /* Charge step configuration */
 - config = ts_dev-bit_xp | ts_dev-bit_yn |
 - STEPCHARGE_RFP_XPUL | STEPCHARGE_RFM_XNUR |
 - STEPCHARGE_INM_AN1 | STEPCHARGE_INP(ts_dev-inp_yp);
 + /* Make CHARGECONFIG same as IDLECONFIG */
  
 + config = titsc_readl(ts_dev, REG_IDLECONFIG);
   titsc_writel(ts_dev, REG_CHARGECONFIG, config);
   titsc_writel(ts_dev, REG_CHARGEDELAY, CHARGEDLY_OPENDLY);
  
 @@ -264,9 +262,26 @@ static irqreturn_t titsc_irq(int irq, void *dev)
   unsigned int status, irqclr = 0;
   unsigned int x = 0, y = 0;
   unsigned int z1, z2, z;
 - unsigned int fsm;
  
 - status = titsc_readl(ts_dev, REG_IRQSTATUS);
 + status = titsc_readl(ts_dev, REG_RAWIRQSTATUS);
 + if (status  IRQENB_HW_PEN) {
 + ts_dev-pen_down = true;
 + titsc_writel(ts_dev, REG_IRQWAKEUP, 0x00);
 + titsc_writel(ts_dev, REG_IRQCLR, IRQENB_HW_PEN);
 + irqclr |= IRQENB_HW_PEN;
 + }
 +
 + if (status  IRQENB_PENUP) {
 + ts_dev-pen_down = false;
 + input_report_key(input_dev, BTN_TOUCH, 0);
 + input_report_abs(input_dev, ABS_PRESSURE, 0);
 + input_sync(input_dev);
 + irqclr |= IRQENB_PENUP;
 + }
 +
 + if (status  IRQENB_EOS)
 + irqclr |= IRQENB_EOS;
 +
   /*
* ADC and touchscreen share the IRQ line.
* FIFO1 interrupts are used by ADC. Handle FIFO0 IRQs here only
 @@ -297,34 +312,6 @@ static irqreturn_t titsc_irq(int irq, void *dev)
   }
   irqclr |= IRQENB_FIFO0THRES;
   }
 -
 - /*
 -  * Time for sequencer to settle, to read
 -  * correct state of the sequencer.
 -  */
 - udelay(SEQ_SETTLE);
 -
 - status = titsc_readl(ts_dev, REG_RAWIRQSTATUS);
 - if (status  IRQENB_PENUP) {
 - /* Pen up event */
 - fsm = titsc_readl(ts_dev, REG_ADCFSM);
 - if (fsm == ADCFSM_STEPID) {
 - ts_dev-pen_down = false;
 - input_report_key(input_dev, BTN_TOUCH, 0);
 - input_report_abs(input_dev, ABS_PRESSURE, 0);
 - input_sync(input_dev);
 - } else {
 - ts_dev-pen_down = true;
 - }
 - irqclr |= IRQENB_PENUP;
 - }
 -
 - if (status  IRQENB_HW_PEN) {
 -
 - titsc_writel(ts_dev, REG_IRQWAKEUP, 0x00);
 - titsc_writel(ts_dev, REG_IRQCLR, IRQENB_HW_PEN);
 - }
 -
   if (irqclr) {
   titsc_writel(ts_dev, REG_IRQSTATUS, irqclr);
   am335x_tsc_se_set_cache(ts_dev-mfd_tscadc, ts_dev-step_mask);
 @@ -417,6 +404,7 @@ static int titsc_probe(struct platform_device *pdev)
   }
  
   titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_FIFO0THRES);
 + titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_EOS);
   err = titsc_config_wires(ts_dev);
   if (err) {
   dev_err(pdev-dev, wrong i/p wire configuration\n);
 diff --git a/include/linux/mfd/ti_am335x_tscadc.h 
 b/include/linux/mfd/ti_am335x_tscadc.h
 index e2e70053470e..c99be5dc0f5c 100644
 --- a/include/linux/mfd/ti_am335x_tscadc.h
 +++ b/include/linux/mfd/ti_am335x_tscadc.h
 @@ -52,6 +52,7 @@
  
  /* IRQ enable

Re: [PATCH 3/5] mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save

2014-11-10 Thread Lee Jones
On Fri, 07 Nov 2014, Vignesh R wrote:

 In one shot mode, sequencer automatically disables all enabled steps at
 the end of each cycle. (both ADC steps and TSC steps) Hence these steps
 need not be saved in reg_se_cache for clearing these steps at a later
 stage.
 Also, when ADC wakes up Sequencer should not be busy executing any of the
 config steps except for the charge step. Previously charge step was 1 ADC
 clock cycle and hence it was ignored.
 
 Signed-off-by: Vignesh R vigne...@ti.com
 ---
  drivers/mfd/ti_am335x_tscadc.c   | 7 +--
  include/linux/mfd/ti_am335x_tscadc.h | 1 +
  2 files changed, 6 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
 index d877e777cce6..94ef8992f46b 100644
 --- a/drivers/mfd/ti_am335x_tscadc.c
 +++ b/drivers/mfd/ti_am335x_tscadc.c
 @@ -86,8 +86,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
   spin_lock_irq(tsadc-reg_lock);
   finish_wait(tsadc-reg_se_wait, wait);
  
 + /*
 +  * Sequencer should either be idle or
 +  * busy applying the charge step.
 +  */
   reg = tscadc_readl(tsadc, REG_ADCFSM);
 - WARN_ON(reg  SEQ_STATUS);
 + WARN_ON(reg  SEQ_STATUS  (!CHARGE_STEP));

This is almost certainly not correct.

Please take another look at the logic.

I'm _assuming_ you mean (reg  SEQ_STATUS  !CHARGE_STEP).

   tsadc-adc_waiting = false;
   }
   tsadc-adc_in_use = true;
 @@ -96,7 +100,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
  void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
  {
   spin_lock_irq(tsadc-reg_lock);
 - tsadc-reg_se_cache |= val;
   am335x_tscadc_need_adc(tsadc);
  
   tscadc_writel(tsadc, REG_SE, val);
 diff --git a/include/linux/mfd/ti_am335x_tscadc.h 
 b/include/linux/mfd/ti_am335x_tscadc.h
 index c99be5dc0f5c..fcce182e4a35 100644
 --- a/include/linux/mfd/ti_am335x_tscadc.h
 +++ b/include/linux/mfd/ti_am335x_tscadc.h
 @@ -128,6 +128,7 @@
  
  /* Sequencer Status */
  #define SEQ_STATUS BIT(5)
 +#define CHARGE_STEP  0x11
  
  #define ADC_CLK  300
  #define TOTAL_STEPS  16

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/5] mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save

2014-11-10 Thread Lee Jones
On Mon, 10 Nov 2014, Lee Jones wrote:

 On Fri, 07 Nov 2014, Vignesh R wrote:
 
  In one shot mode, sequencer automatically disables all enabled steps at
  the end of each cycle. (both ADC steps and TSC steps) Hence these steps
  need not be saved in reg_se_cache for clearing these steps at a later
  stage.
  Also, when ADC wakes up Sequencer should not be busy executing any of the
  config steps except for the charge step. Previously charge step was 1 ADC
  clock cycle and hence it was ignored.
  
  Signed-off-by: Vignesh R vigne...@ti.com
  ---
   drivers/mfd/ti_am335x_tscadc.c   | 7 +--
   include/linux/mfd/ti_am335x_tscadc.h | 1 +
   2 files changed, 6 insertions(+), 2 deletions(-)
  
  diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
  index d877e777cce6..94ef8992f46b 100644
  --- a/drivers/mfd/ti_am335x_tscadc.c
  +++ b/drivers/mfd/ti_am335x_tscadc.c
  @@ -86,8 +86,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
  *tsadc)
  spin_lock_irq(tsadc-reg_lock);
  finish_wait(tsadc-reg_se_wait, wait);
   
  +   /*
  +* Sequencer should either be idle or
  +* busy applying the charge step.
  +*/
  reg = tscadc_readl(tsadc, REG_ADCFSM);
  -   WARN_ON(reg  SEQ_STATUS);
  +   WARN_ON(reg  SEQ_STATUS  (!CHARGE_STEP));
 
 This is almost certainly not correct.
 
 Please take another look at the logic.
 
 I'm _assuming_ you mean (reg  SEQ_STATUS  !CHARGE_STEP).

So I just saw that CHARGE_STEP is actually the new macro below.

So you're currently ANDing these together.

     reg
   0010  #define SEQ_STATUS   BIT(5)
   00010001  #define CHARGE_STEP  0x11

... which will always equate to 0.

  tsadc-adc_waiting = false;
  }
  tsadc-adc_in_use = true;
  @@ -96,7 +100,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
  *tsadc)
   void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
   {
  spin_lock_irq(tsadc-reg_lock);
  -   tsadc-reg_se_cache |= val;

Didn't you add this line a little over 1 month ago?

Why the change of heart?

  am335x_tscadc_need_adc(tsadc);
   
  tscadc_writel(tsadc, REG_SE, val);
  diff --git a/include/linux/mfd/ti_am335x_tscadc.h 
  b/include/linux/mfd/ti_am335x_tscadc.h
  index c99be5dc0f5c..fcce182e4a35 100644
  --- a/include/linux/mfd/ti_am335x_tscadc.h
  +++ b/include/linux/mfd/ti_am335x_tscadc.h
  @@ -128,6 +128,7 @@
   
   /* Sequencer Status */
   #define SEQ_STATUS BIT(5)
  +#define CHARGE_STEP0x11
   
   #define ADC_CLK300
   #define TOTAL_STEPS16
 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: twl4030-power: Fix poweroff with PM configuration enabled

2014-11-10 Thread Lee Jones
On Sun, 02 Nov 2014, Tony Lindgren wrote:

 Commit e7cd1d1eb16f (mfd: twl4030-power: Add generic reset
 configuration) enabled configuring the PM features for twl4030.
 
 This caused poweroff command to fail on devices that have the
 BCI charger on twl4030 wired, or have power wired for VBUS.
 Instead of powering off, the device reboots. This is because
 voltage is detected on charger or VBUS with the default bits
 enabled for the power transition registers.
 
 To fix the issue, let's just clear VBUS and CHG bits as we want
 poweroff command to keep the system powered off.
 
 Fixes: e7cd1d1eb16f (mfd: twl4030-power: Add generic reset configuration)
 Cc: sta...@vger.kernel.org # v3.16+
 Reported-by: Russell King rmk+ker...@arm.linux.org.uk
 Signed-off-by: Tony Lindgren t...@atomide.com

Applied to -fixes.

Not sure whether that was an Ack from Russell or not?

 --- a/drivers/mfd/twl4030-power.c
 +++ b/drivers/mfd/twl4030-power.c
 @@ -44,6 +44,15 @@ static u8 twl4030_start_script_address = 0x2b;
  #define PWR_DEVSLP   BIT(1)
  #define PWR_DEVOFF   BIT(0)
  
 +/* Register bits for CFG_P1_TRANSITION (also for P2 and P3) */
 +#define STARTON_SWBUGBIT(7)  /* Start on watchdog */
 +#define STARTON_VBUS BIT(5)  /* Start on VBUS */
 +#define STARTON_VBAT BIT(4)  /* Start on battery insert */
 +#define STARTON_RTC  BIT(3)  /* Start on RTC */
 +#define STARTON_USB  BIT(2)  /* Start on USB host */
 +#define STARTON_CHG  BIT(1)  /* Start on charger */
 +#define STARTON_PWON BIT(0)  /* Start on PWRON button */
 +
  #define SEQ_OFFSYNC  (1  0)
  
  #define PHY_TO_OFF_PM_MASTER(p)  (p - 0x36)
 @@ -606,6 +615,44 @@ twl4030_power_configure_resources(const struct 
 twl4030_power_data *pdata)
   return 0;
  }
  
 +static int twl4030_starton_mask_and_set(u8 bitmask, u8 bitvalues)
 +{
 + u8 regs[3] = { TWL4030_PM_MASTER_CFG_P1_TRANSITION,
 +TWL4030_PM_MASTER_CFG_P2_TRANSITION,
 +TWL4030_PM_MASTER_CFG_P3_TRANSITION, };
 + u8 val;
 + int i, err;
 +
 + err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1,
 +TWL4030_PM_MASTER_PROTECT_KEY);
 + if (err)
 + goto relock;
 + err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER,
 +TWL4030_PM_MASTER_KEY_CFG2,
 +TWL4030_PM_MASTER_PROTECT_KEY);
 + if (err)
 + goto relock;
 +
 + for (i = 0; i  sizeof(regs); i++) {
 + err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER,
 +   val, regs[i]);
 + if (err)
 + break;
 + val = (~bitmask  val) | (bitmask  bitvalues);
 + err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER,
 +val, regs[i]);
 + if (err)
 + break;
 + }
 +
 + if (err)
 + pr_err(TWL4030 Register access failed: %i\n, err);
 +
 +relock:
 + return twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 0,
 + TWL4030_PM_MASTER_PROTECT_KEY);
 +}
 +
  /*
   * In master mode, start the power off sequence.
   * After a successful execution, TWL shuts down the power to the SoC
 @@ -615,6 +662,11 @@ void twl4030_power_off(void)
  {
   int err;
  
 + /* Disable start on charger or VBUS as it can break poweroff */
 + err = twl4030_starton_mask_and_set(STARTON_VBUS | STARTON_CHG, 0);
 + if (err)
 + pr_err(TWL4030 Unable to configure start-up\n);
 +
   err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, PWR_DEVOFF,
  TWL4030_PM_MASTER_P1_SW_EVENTS);
   if (err)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] input: touchscreen: ti_am335x_tsc: Remove udelay in interrupt handler

2014-11-03 Thread Lee Jones
On Mon, 27 Oct 2014, Vignesh R wrote:
 From: Brad Griffis bgrif...@ti.com
 
 TSC interrupt handler had udelay to avoid reporting of false pen-up
 interrupt to user space. This patch implements workaround suggesting in
 Advisory 1.0.31 of silicon errata for am335x, thus eliminating udelay
 and touchscreen lag. This also improves performance of touchscreen and
 eliminates sudden jump of cursor at touch release.
 
 IDLECONFIG and CHARGECONFIG registers are to be configured
 with same values in order to eliminate false pen-up events. This
 workaround may result in false pen-down to be detected, hence considerable
 charge step delay needs to be added. The charge delay is set to 0xB000
 (in terms of ADC clock cycles) by default.
 
 TSC steps are disabled at the end of every sampling cycle and EOS bit is
 set. Once the EOS bit is set, the TSC steps need to be re-enabled to begin
 next sampling cycle.
 
 In one shot mode, sequencer automatically disables all enabled steps at
 the end of each cycle. (both ADC steps and TSC steps) Hence these steps
 need not be saved in reg_se_cache for clearing these steps at a later
 stage.
 
 Signed-off-by: Brad Griffis bgrif...@ti.com
 [vigne...@ti.com: Ported patch from v3.12 to v3.18rc2]
 Signed-off-by: Vignesh R vigne...@ti.com
 ---
  drivers/input/touchscreen/ti_am335x_tsc.c | 56 
 ---
  drivers/mfd/ti_am335x_tscadc.c|  7 ++--
  include/linux/mfd/ti_am335x_tscadc.h  |  4 ++-
  3 files changed, 30 insertions(+), 37 deletions(-)

[...]

 diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
 index d877e777cce6..94ef8992f46b 100644
 --- a/drivers/mfd/ti_am335x_tscadc.c
 +++ b/drivers/mfd/ti_am335x_tscadc.c
 @@ -86,8 +86,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
   spin_lock_irq(tsadc-reg_lock);
   finish_wait(tsadc-reg_se_wait, wait);
  
 + /*
 +  * Sequencer should either be idle or
 +  * busy applying the charge step.
 +  */
   reg = tscadc_readl(tsadc, REG_ADCFSM);
 - WARN_ON(reg  SEQ_STATUS);
 + WARN_ON(reg  SEQ_STATUS  (!CHARGE_STEP));
   tsadc-adc_waiting = false;
   }
   tsadc-adc_in_use = true;
 @@ -96,7 +100,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev 
 *tsadc)
  void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
  {
   spin_lock_irq(tsadc-reg_lock);
 - tsadc-reg_se_cache |= val;
   am335x_tscadc_need_adc(tsadc);
  
   tscadc_writel(tsadc, REG_SE, val);

I believe all of these changes can, and therefor should live in a
separate patch.

 diff --git a/include/linux/mfd/ti_am335x_tscadc.h 
 b/include/linux/mfd/ti_am335x_tscadc.h
 index e2e70053470e..fcce182e4a35 100644
 --- a/include/linux/mfd/ti_am335x_tscadc.h
 +++ b/include/linux/mfd/ti_am335x_tscadc.h
 @@ -52,6 +52,7 @@
  
  /* IRQ enable */
  #define IRQENB_HW_PENBIT(0)
 +#define IRQENB_EOS   BIT(1)
  #define IRQENB_FIFO0THRESBIT(2)
  #define IRQENB_FIFO0OVRRUN   BIT(3)
  #define IRQENB_FIFO0UNDRFLW  BIT(4)
 @@ -107,7 +108,7 @@
  /* Charge delay */
  #define CHARGEDLY_OPEN_MASK  (0x3  0)
  #define CHARGEDLY_OPEN(val)  ((val)  0)
 -#define CHARGEDLY_OPENDLYCHARGEDLY_OPEN(1)
 +#define CHARGEDLY_OPENDLYCHARGEDLY_OPEN(0xB000)
  
  /* Control register */
  #define CNTRLREG_TSCSSENBBIT(0)
 @@ -127,6 +128,7 @@
  
  /* Sequencer Status */
  #define SEQ_STATUS BIT(5)
 +#define CHARGE_STEP  0x11
  
  #define ADC_CLK  300
  #define TOTAL_STEPS  16

The header changes should be split between the two Input and MFD
patches.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: twl4030-power: Fix poweroff with PM configuration enabled

2014-11-03 Thread Lee Jones
On Sun, 02 Nov 2014, Tony Lindgren wrote:

 Commit e7cd1d1eb16f (mfd: twl4030-power: Add generic reset
 configuration) enabled configuring the PM features for twl4030.
 
 This caused poweroff command to fail on devices that have the
 BCI charger on twl4030 wired, or have power wired for VBUS.
 Instead of powering off, the device reboots. This is because
 voltage is detected on charger or VBUS with the default bits
 enabled for the power transition registers.
 
 To fix the issue, let's just clear VBUS and CHG bits as we want
 poweroff command to keep the system powered off.
 
 Fixes: e7cd1d1eb16f (mfd: twl4030-power: Add generic reset configuration)
 Cc: sta...@vger.kernel.org # v3.16+
 Reported-by: Russell King rmk+ker...@arm.linux.org.uk

It would be good to have Russell to review this to ensure he is happy
with the implementation.

 Signed-off-by: Tony Lindgren t...@atomide.com

[...]

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: twl4030-power: Fix regression with missing compatible flag

2014-11-03 Thread Lee Jones
On Sun, 02 Nov 2014, Tony Lindgren wrote:

 Commit e7cd1d1eb16f (mfd: twl4030-power: Add generic reset
 configuration) accidentally removed the compatible flag for
 ti,twl4030-power that should be there as documented in the
 binding.
 
 If ti,twl4030-power only the poweroff configuration is done
 by the driver.
 
 Fixes: e7cd1d1eb16f (mfd: twl4030-power: Add generic reset configuration)
 Cc: sta...@vger.kernel.org # v3.16+
 Reported-by: Dr. H. Nikolaus Schaller h...@goldelico.com
 Signed-off-by: Tony Lindgren t...@atomide.com

Applied, thanks.

 --- a/drivers/mfd/twl4030-power.c
 +++ b/drivers/mfd/twl4030-power.c
 @@ -831,6 +831,9 @@ static struct twl4030_power_data osc_off_idle = {
  
  static struct of_device_id twl4030_power_of_match[] = {
   {
 + .compatible = ti,twl4030-power,
 + },
 + {
   .compatible = ti,twl4030-power-reset,
   .data = omap3_reset,
   },

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: ti_am335x_tscadc: Update logic in CTRL register for 5-wire TS

2014-09-24 Thread Lee Jones
On Thu, 04 Sep 2014, Sebastian Andrzej Siewior wrote:

 From: Jeff Lance j-lan...@ti.com
 
 The logic in AFE_Pen_Ctrl bitmask in the CTRL register is different for five
 wire versus four or eight wire touschscreens. This patch should fix this for
 five-wire touch screens. There should be no change needed here for four and
 eight wire tousch screens.
 
 Signed-off-by: Jeff Lance j-lan...@ti.com
 [bigeasy: keep the change mfd only]
 Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de
 ---
 I've been looking at moving this piece and the idle mode setting into the
 TSC driver. Kinda odd that I have to patch within the MFD driver for this
 TSC related change.
 Anyone disagrees?
 
  drivers/mfd/ti_am335x_tscadc.c   | 30 +-
  include/linux/mfd/ti_am335x_tscadc.h |  1 +
  2 files changed, 18 insertions(+), 13 deletions(-)

I hope this has been fully tested.

Looks like it could work though, so applied, thanks.

 diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
 index dd4bf5816221..6c9cfb8c1d01 100644
 --- a/drivers/mfd/ti_am335x_tscadc.c
 +++ b/drivers/mfd/ti_am335x_tscadc.c
 @@ -241,18 +241,20 @@ static  int ti_tscadc_probe(struct platform_device 
 *pdev)
   tscadc_writel(tscadc, REG_CLKDIV, tscadc-clk_div);
  
   /* Set the control register bits */
 - ctrl = CNTRLREG_STEPCONFIGWRT |
 - CNTRLREG_STEPID;
 - if (tsc_wires  0)
 - ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB;
 + ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID;
   tscadc_writel(tscadc, REG_CTRL, ctrl);
  
   /* Set register bits for Idle Config Mode */
 - if (tsc_wires  0)
 + if (tsc_wires  0) {
 + tscadc-tsc_wires = tsc_wires;
 + if (tsc_wires == 5)
 + ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB;
 + else
 + ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB;
   tscadc_idle_config(tscadc);
 + }
  
   /* Enable the TSC module enable bit */
 - ctrl = tscadc_readl(tscadc, REG_CTRL);
   ctrl |= CNTRLREG_TSCSSENB;
   tscadc_writel(tscadc, REG_CTRL, ctrl);
  
 @@ -324,21 +326,23 @@ static int tscadc_suspend(struct device *dev)
  static int tscadc_resume(struct device *dev)
  {
   struct ti_tscadc_dev*tscadc_dev = dev_get_drvdata(dev);
 - unsigned int restore, ctrl;
 + u32 ctrl;
  
   pm_runtime_get_sync(dev);
  
   /* context restore */
   ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID;
 - if (tscadc_dev-tsc_cell != -1)
 - ctrl |= CNTRLREG_TSCENB | CNTRLREG_4WIRE;
   tscadc_writel(tscadc_dev, REG_CTRL, ctrl);
  
 - if (tscadc_dev-tsc_cell != -1)
 + if (tscadc_dev-tsc_cell != -1) {
 + if (tscadc_dev-tsc_wires == 5)
 + ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB;
 + else
 + ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB;
   tscadc_idle_config(tscadc_dev);
 - restore = tscadc_readl(tscadc_dev, REG_CTRL);
 - tscadc_writel(tscadc_dev, REG_CTRL,
 - (restore | CNTRLREG_TSCSSENB));
 + }
 + ctrl |= CNTRLREG_TSCSSENB;
 + tscadc_writel(tscadc_dev, REG_CTRL, ctrl);
  
   tscadc_writel(tscadc_dev, REG_CLKDIV, tscadc_dev-clk_div);
  
 diff --git a/include/linux/mfd/ti_am335x_tscadc.h 
 b/include/linux/mfd/ti_am335x_tscadc.h
 index fb96c84dada5..e2e70053470e 100644
 --- a/include/linux/mfd/ti_am335x_tscadc.h
 +++ b/include/linux/mfd/ti_am335x_tscadc.h
 @@ -155,6 +155,7 @@ struct ti_tscadc_dev {
   void __iomem *tscadc_base;
   int irq;
   int used_cells; /* 1-2 */
 + int tsc_wires;
   int tsc_cell;   /* -1 if not used */
   int adc_cell;   /* -1 if not used */
   struct mfd_cell cells[TSCADC_CELLS];

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 3/3] mfd: palmas: Add support for optional wakeup

2014-09-18 Thread Lee Jones
-dev;
  +
  +   if (!palmas-wakeirq)
  +   return 0;
  +
  +   if (device_may_wakeup(dev))
  +   enable_irq(palmas-wakeirq);
  +
  +   return 0;
  +}
  +
  +static int palmas_i2c_resume(struct i2c_client *i2c)
  +{
  +   struct palmas *palmas = i2c_get_clientdata(i2c);
  +   struct device *dev = i2c-dev;
  +
  +   if (!palmas-wakeirq)
  +   return 0;
  +
  +   if (device_may_wakeup(dev))
  +   disable_irq_nosync(palmas-wakeirq);
  +
  +   return 0;
  +}
  +
   static const struct i2c_device_id palmas_i2c_id[] = {
  { palmas, },
  { twl6035, },
  @@ -721,6 +781,8 @@ static struct i2c_driver palmas_i2c_driver = {
 .of_match_table = of_palmas_match_tbl,
 .owner = THIS_MODULE,
  },
  +   .suspend = palmas_i2c_suspend,
  +   .resume = palmas_i2c_resume,
  .probe = palmas_i2c_probe,
  .remove = palmas_i2c_remove,
  .id_table = palmas_i2c_id,
  diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
  index fb0390a..e8cf4c2 100644
  --- a/include/linux/mfd/palmas.h
  +++ b/include/linux/mfd/palmas.h
  @@ -75,6 +75,7 @@ struct palmas {
  /* IRQ Data */
  int irq;
  u32 irq_mask;
  +   int wakeirq;
  struct mutex irq_lock;
  struct regmap_irq_chip_data *irq_data;
   
  @@ -377,6 +378,7 @@ struct palmas_clk_platform_data {
   
   struct palmas_platform_data {
  int irq_flags;
  +   int wakeirq;
  int gpio_base;
   
  /* bit value to be loaded to the POWER_CTRL register */
  
 
 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 1/2] Documentation: devicetree: mfd: twl4030-power: Use the standard 'ti,system-power-controller' to mark power control

2014-09-17 Thread Lee Jones
On Wed, 17 Sep 2014, Nishanth Menon wrote:

 ti,system-power-controller is more or less the standard way of
 indicating that the PMIC is the system wide power controller and hence
 may be used to switch off the system. Almost ALL TI PMIC drivers and
 many Maxim PMIC drivers follow the same style.
 
 So support 'ti,system-power-controller' in addition to the usual
 'ti,use_poweroff' to indicate that the PMIC instance has control for
 switching off the system.
 
 Signed-off-by: Nishanth Menon n...@ti.com
 ---
 
 V2: picked up documentation suggestion from Sebastien

It would be good to get Sebastian's Ack.

 V1: https://patchwork.kernel.org/patch/4836381/
 
  .../devicetree/bindings/mfd/twl4030-power.txt  |9 +++--
  1 file changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/Documentation/devicetree/bindings/mfd/twl4030-power.txt 
 b/Documentation/devicetree/bindings/mfd/twl4030-power.txt
 index b9ee7b9..a7390c7 100644
 --- a/Documentation/devicetree/bindings/mfd/twl4030-power.txt
 +++ b/Documentation/devicetree/bindings/mfd/twl4030-power.txt
 @@ -23,8 +23,13 @@ down during off-idle. Note that this does not work on all 
 boards
  depending on how the external oscillator is wired.
  
  Optional properties:
 -- ti,use_poweroff: With this flag, the chip will initiates an ACTIVE-to-OFF 
 or
 -SLEEP-to-OFF transition when the system poweroffs.
 +
 +- ti,system-power-controller: This indicates that TWL4030 is the
 +  power supply master of the system. With this flag, the chip will
 +  initiates an ACTIVE-to-OFF or SLEEP-to-OFF transition when the
 +  system poweroffs.
 +
 +- ti,use_poweroff: Deprecated name for ti,system-power-controller
  
  Example:
  i2c1 {

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 1/2] Documentation: devicetree: mfd: twl4030-power: Use the standard 'ti,system-power-controller' to mark power control

2014-09-17 Thread Lee Jones
On Wed, 17 Sep 2014, Sebastian Reichel wrote:

 On Wed, Sep 17, 2014 at 08:44:00AM -0700, Lee Jones wrote:
  On Wed, 17 Sep 2014, Nishanth Menon wrote:
   ti,system-power-controller is more or less the standard way of
   indicating that the PMIC is the system wide power controller and hence
   may be used to switch off the system. Almost ALL TI PMIC drivers and
   many Maxim PMIC drivers follow the same style.
   
   So support 'ti,system-power-controller' in addition to the usual
   'ti,use_poweroff' to indicate that the PMIC instance has control for
   switching off the system.
   
   Signed-off-by: Nishanth Menon n...@ti.com
   ---
   
   V2: picked up documentation suggestion from Sebastien
  
  It would be good to get Sebastian's Ack.
 
 Acked-By: Sebastian Reichel s...@kernel.org
 
 [...]
 
   +- ti,system-power-controller: This indicates that TWL4030 is the
   +  power supply master of the system. With this flag, the chip will
   +  initiates an ACTIVE-to-OFF or SLEEP-to-OFF transition when the
   +  system poweroffs.
 
 One minor thing: While the documentation is updated you may want to
 fix the typo will initiates to will initiate (or just drop the
 will).

Applied with Sebastian's Ack and I fixed this up too.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 2/2] mfd: twl4030-power: use 'ti,system-power-controller' as alternative way to support system power off

2014-09-17 Thread Lee Jones
On Wed, 17 Sep 2014, Nishanth Menon wrote:

 ti,system-power-controller is more or less the standard way of
 indicating that the PMIC is the system wide power controller and hence
 may be used to switch off the system. Almost ALL TI PMIC drivers and
 many Maxim PMIC drivers follow the same style.
 
 So support 'ti,system-power-controller' in addition to the usual
 'ti,use_poweroff' to indicate that the PMIC instance has control for
 switching off the system.
 
 Signed-off-by: Nishanth Menon n...@ti.com
 Acked-by: Tony Lindgren t...@atomide.com
 ---
 
 V2: no change, picked up Tony's ack.
 V1: https://patchwork.kernel.org/patch/4836371/
  drivers/mfd/twl4030-power.c |3 +++
  1 file changed, 3 insertions(+)

Applied, thanks.

 diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
 index 3bc969a..1c129ba 100644
 --- a/drivers/mfd/twl4030-power.c
 +++ b/drivers/mfd/twl4030-power.c
 @@ -627,6 +627,9 @@ static bool twl4030_power_use_poweroff(const struct 
 twl4030_power_data *pdata,
   if (pdata  pdata-use_poweroff)
   return true;
  
 + if (of_property_read_bool(node, ti,system-power-controller))
 + return true;
 +
   if (of_property_read_bool(node, ti,use_poweroff))
   return true;
  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] mfd: twl4030-power: use 'ti,system-power-controller' as alternative way to support system power off

2014-09-16 Thread Lee Jones
On Mon, 08 Sep 2014, Tony Lindgren wrote:

 * Nishanth Menon n...@ti.com [140903 12:07]:
  ti,system-power-controller is more or less the standard way of
  indicating that the PMIC is the system wide power controller and hence
  may be used to switch off the system. Almost ALL TI PMIC drivers and
  many Maxim PMIC drivers follow the same style.
  
  So support 'ti,system-power-controller' in addition to the usual
  'ti,use_poweroff' to indicate that the PMIC instance has control for
  switching off the system.
  
  Signed-off-by: Nishanth Menon n...@ti.com
 
 Acked-by: Tony Lindgren t...@atomide.com

I assume you're going to resend this with the document modifications?
When you do, don't forget to apply Tony's Ack, as it will ensure a
faster merge.

  ---
   drivers/mfd/twl4030-power.c |3 +++
   1 file changed, 3 insertions(+)
  
  diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
  index 3bc969a..1c129ba 100644
  --- a/drivers/mfd/twl4030-power.c
  +++ b/drivers/mfd/twl4030-power.c
  @@ -627,6 +627,9 @@ static bool twl4030_power_use_poweroff(const struct 
  twl4030_power_data *pdata,
  if (pdata  pdata-use_poweroff)
  return true;
   
  +   if (of_property_read_bool(node, ti,system-power-controller))
  +   return true;
  +
  if (of_property_read_bool(node, ti,use_poweroff))
  return true;
   

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: palmas: Add support for optional wakeup

2014-09-02 Thread Lee Jones
On Mon, 01 Sep 2014, Nishanth Menon wrote:

 On 09/01/2014 04:32 AM, Lee Jones wrote:
 On Fri, 29 Aug 2014, Nishanth Menon wrote:
 On 08/29/2014 05:56 AM, Lee Jones wrote:
 On Tue, 19 Aug 2014, Nishanth Menon wrote:
 
 With the recent pinctrl-single changes, omaps can treat wake-up events
 from deeper idle states as interrupts.
 
 Let's add support for the optional second interrupt for wake-up
 events. And then SoC can wakeup and handle the event using it's
 regular handler.
 
 Finally, to pass the wake-up interrupt in the dts file,
 interrupts-extended property needs to be passed.
 
 This is similar in approach to commit 2a0b965cfb6e (serial: omap: Add
 support for optional wake-up)
 
 Signed-off-by: Nishanth Menon n...@ti.com
 ---
   Documentation/devicetree/bindings/mfd/palmas.txt |   20 
 
 DT Ack please.
 
 Please read Documentation/devicetree/bindings/submittingpatches.txt
 
 I assume you wanted me to note the following:
 
 The Documentation/ portion of the patch should be a separate patch.
 
 
 Many maintainers prefer that when the bindings for the device is
 new, and when additional properties are added, they prefer it part
 of same patch.. Anyways.. if the above is what you prefer, I can
 follow that.

I tend to like it done properly please.

 In short, I assume you'd like three patches:
 a) fix up style of current documentation - palmas to palmas@40
 b) Split documentation for interrupt-extended from the current patch
 into it's own patch.
 c) remainder of this patch as is..
 
 Does that sound right?

That does, thanks.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: palmas: Add support for optional wakeup

2014-09-01 Thread Lee Jones
On Fri, 29 Aug 2014, Nishanth Menon wrote:
 On 08/29/2014 05:56 AM, Lee Jones wrote:
  On Tue, 19 Aug 2014, Nishanth Menon wrote:
  
  With the recent pinctrl-single changes, omaps can treat wake-up events
  from deeper idle states as interrupts.
 
  Let's add support for the optional second interrupt for wake-up
  events. And then SoC can wakeup and handle the event using it's
  regular handler.
 
  Finally, to pass the wake-up interrupt in the dts file,
  interrupts-extended property needs to be passed.
 
  This is similar in approach to commit 2a0b965cfb6e (serial: omap: Add
  support for optional wake-up)
 
  Signed-off-by: Nishanth Menon n...@ti.com
  ---
   Documentation/devicetree/bindings/mfd/palmas.txt |   20 
  
  DT Ack please.

Please read Documentation/devicetree/bindings/submittingpatches.txt

   drivers/mfd/palmas.c |   59 
  ++
   include/linux/mfd/palmas.h   |2 +
   3 files changed, 81 insertions(+)
 
  diff --git a/Documentation/devicetree/bindings/mfd/palmas.txt 
  b/Documentation/devicetree/bindings/mfd/palmas.txt
  index eda8989..2627842 100644
  --- a/Documentation/devicetree/bindings/mfd/palmas.txt
  +++ b/Documentation/devicetree/bindings/mfd/palmas.txt
  @@ -51,3 +51,23 @@ palmas {
 
 };
   }
  +
  +Example: with interrupts extended
  + See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
  + Use pinmux 0x418 as wakeup interrupt and gpio1_0 as interrupt source
  +
  +palmas {
  
  Should this be 'palmas@40 {'?
 
 I might have preferred that as well.. I kept the existing style in the
 documentation. Would you like me to change existing doc style too?

Yes please.  Although you can do this subseqently.

[...]

  +static irqreturn_t palmas_wake_irq(int irq, void *_palmas)
  +{
  +  /*
  +   * Return Not handled so that interrupt is disabled.
  +   * Level event ensures that the event is eventually handled
  +   * by the appropriate chip handler already registered
  +   */
  
  This looks okay to me, but could do with a second opinion from someone
  who is a little more familier with this kind of h/w.
  
  How does this differ from threading IRQs?
 
 I could try with an example:
 consider a GPIO block 7 gpio 4 connected to a pinctrl pin 234 as the
 interrupt source for palmas.
 
 When the system is active, the GPIO block 7, gpio 4 happily functions
 as the interrupt source. However, the SoC might not capable of
 achieving SoC wide deepsleep when GPIO block 7 is active, So we have
 to power off GPIO block 7. However on achieving low power, the system
 needs to be capable of waking backup, for this, SoC uses the hardware
 at the pin itself(TI calls it control module, others have other names,
 lets for the discussion, call it pinctrl), on going to sleep the
 action of enabling the pinctrl irq - enables the wakeup capability of
 the pin, and disabling it disabled the wakeup capability. when the
 wakeup event does take place, in some cases, it might be a edge event,
 where by the time we have recofigured GPIO block, the interrupt event
 is long gone - to support this, pinctrl invokes the driver interrupt
 handler to ensure this functions. in our case(palmas), we are level
 event and can depend on GPIO block to handle it when it is configured.
 
 Basically two interrupt sources when SoC is in deep sleep(1 to exit
 from deepsleep, and other from the module handling the actual event) -
 Example: powerbutton press OR palmas RTC wakeup OR Palmas GPIO
 generated wakeup.
 
 However, this is not the same as threading IRQ as the wakeup event is
 involved only during suspend path.
 
 commit 2a0b965cfb6e (serial: omap: Add support for optional wake-up)
 
 is a good reference from serial port handling perspective.

Thanks for the explanation.  This makes sense now.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: palmas: Add support for optional wakeup

2014-08-29 Thread Lee Jones
 palmas *palmas = i2c_get_clientdata(i2c);
 + struct device *dev = i2c-dev;
 +
 + if (!palmas-wakeirq)
 + return 0;
 +
 + if (device_may_wakeup(dev))
 + disable_irq_nosync(palmas-wakeirq);
 +
 + return 0;
 +}
 +
  static const struct i2c_device_id palmas_i2c_id[] = {
   { palmas, },
   { twl6035, },
 @@ -721,6 +778,8 @@ static struct i2c_driver palmas_i2c_driver = {
  .of_match_table = of_palmas_match_tbl,
  .owner = THIS_MODULE,
   },
 + .suspend = palmas_i2c_suspend,
 + .resume = palmas_i2c_resume,
   .probe = palmas_i2c_probe,
   .remove = palmas_i2c_remove,
   .id_table = palmas_i2c_id,
 diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
 index fb0390a..e8cf4c2 100644
 --- a/include/linux/mfd/palmas.h
 +++ b/include/linux/mfd/palmas.h
 @@ -75,6 +75,7 @@ struct palmas {
   /* IRQ Data */
   int irq;
   u32 irq_mask;
 + int wakeirq;
   struct mutex irq_lock;
   struct regmap_irq_chip_data *irq_data;
  
 @@ -377,6 +378,7 @@ struct palmas_clk_platform_data {
  
  struct palmas_platform_data {
   int irq_flags;
 + int wakeirq;
   int gpio_base;
  
   /* bit value to be loaded to the POWER_CTRL register */

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mfd: twl4030-power: Fix PM idle pin configuration to not conflict with regulators

2014-08-20 Thread Lee Jones
On Tue, 19 Aug 2014, Tony Lindgren wrote:

 Commit 43fef47f94a1 (mfd: twl4030-power: Add a configuration to turn
 off oscillator during off-idle) added support for configuring the PMIC
 to cut off resources during deeper idle states to save power.
 
 This however caused regression for n900 display power that needed the
 PMIC configuration to be disabled with commit d937678ab625 (ARM: dts:
 Revert enabling of twl configuration for n900).
 
 Turns out the root cause of the problem is that we must use
 TWL4030_RESCONFIG_UNDEF instead of DEV_GRP_NULL to avoid disabling
 regulators that may have been enabled before the init function
 for twl4030-power.c runs. With TWL4030_RESCONFIG_UNDEF we let the
 regulator framework control the regulators like it should. Here we
 need to only configure the sys_clken and sys_off_mode triggers for
 the regulators that cannot be done by the regulator framework as
 it's not running at that point.
 
 This allows us to enable the PMIC configuration for n900.
 
 Fixes: 43fef47f94a1 (mfd: twl4030-power: Add a configuration to turn off 
 oscillator during off-idle)
 Cc: sta...@vger.kernel.org # v3.16
 Signed-off-by: Tony Lindgren t...@atomide.com
 
 ---
 
 Lee, can you please pick this one for the v3.17-rc series?

Applied with Aaro's Tested-by.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

2014-07-23 Thread Lee Jones
On Wed, 23 Jul 2014, Peter Griffin wrote:

 Signed-off-by: Peter Griffin peter.grif...@linaro.org
 ---
  MAINTAINERS | 1 +
  1 file changed, 1 insertion(+)

Acked-by: Lee Jones lee.jo...@linaro.org
 
 diff --git a/MAINTAINERS b/MAINTAINERS
 index 702ca10..269ad3b 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -1325,6 +1325,7 @@ F:  drivers/pinctrl/pinctrl-st.c
  F:   drivers/media/rc/st_rc.c
  F:   drivers/i2c/busses/i2c-st.c
  F:   drivers/tty/serial/st-asc.c
 +F:   drivers/usb/dwc3/dwc3-st.c
  
  ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
  M:   Lennert Buytenhek ker...@wantstofly.org

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 2/3] usb: dwc3: dwc3-st: Add st-dwc3 devicetree bindings documentation

2014-07-23 Thread Lee Jones
On Wed, 23 Jul 2014, Peter Griffin wrote:

 This patch documents the device tree documentation required for
 the ST usb3 controller glue layer found in STiH407 devices.
 
 Signed-off-by: Giuseppe Cavallaro peppe.cavall...@st.com
 Signed-off-by: Peter Griffin peter.grif...@linaro.org
 ---
  Documentation/devicetree/bindings/usb/dwc3-st.txt | 69 
 +++
  1 file changed, 69 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt
 
 diff --git a/Documentation/devicetree/bindings/usb/dwc3-st.txt 
 b/Documentation/devicetree/bindings/usb/dwc3-st.txt
 new file mode 100644
 index 000..de3fea3
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/usb/dwc3-st.txt
 @@ -0,0 +1,69 @@
 +ST DWC3 glue logic
 +
 +This file documents the parameters for the dwc3-st driver.
 +This driver controls the glue logic used to configure the dwc3 core on
 +STiH407 based platforms.
 +
 +Required properties:
 + - compatible: must be st,stih407-dwc3

Does this only exist for Cannes?

 + - reg   : glue logic base address and USB syscfg ctrl register 
 offset
 + - reg-names : should be reg-glue and syscfg-reg
 + - st,syscon : should be phandle to system configuration node which
 +   encompasses the glue registers

This should be st,syscfg.  As you have it in the example.

Besides this small issue, I don't see anything controversial so once
fixed up, you can apply my:

Acked-by: Lee Jones lee.jo...@linaro.org

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-23 Thread Lee Jones
On Wed, 23 Jul 2014, Peter Griffin wrote:

 This patch adds the ST glue logic to manage the DWC3 HC
 on STiH407 SoC family. It manages the powerdown signal,
 and configures the internal glue logic and syscfg registers.
 
 Signed-off-by: Giuseppe Cavallaro peppe.cavall...@st.com
 Signed-off-by: Peter Griffin peter.grif...@linaro.org
 ---
  drivers/usb/dwc3/Kconfig   |   9 ++
  drivers/usb/dwc3/Makefile  |   1 +
  drivers/usb/dwc3/dwc3-st.c | 338 
 +
  3 files changed, 348 insertions(+)
  create mode 100644 drivers/usb/dwc3/dwc3-st.c

[...]

 +/*
 + * For all fields in USB2_VBUS_MNGMNT_SEL1
 + * 2’b00 : Override value from Reg 0x30 is selected
 + * 2’b01 : utmiotg_signal_name from usb3_top is selected
 + * 2’b10 : pipew_signal_name from PIPEW instance is selected
 + * 2’b11 : value is 1'b0
 + */
 +#define REG300x0
 +#define UTMIOTG  0x1
 +#define PIPEW0x2
 +#define ZERO 0x3

Possible register values are usually prefixed with something
descriptive which identifies them.

USB2_VBUS_ looks appropriate here.

[...]

 +/**
 + * struct st_dwc3 - st-dwc3 driver private structure
 + * @dwc3:platform device pointer
 + * @dev: device pointer
 + * @glue_baseioaddr for the glue registers
 + * @regmap   regmap pointer for getting syscfg
 + * @syscfg_reg_off   usb syscfg control offset
 + * @dr_mode  drd static host/device config
 + * @rstc_pwrdn   rest controller for powerdown signal
 + * @rstc_rst reset controller for softreset signal

Some of these have ':', some of them don't.  I suggest you standardise
to 'all do'.

 + *

Superflous line in comment.

 + */
 +

Superflous '\n'.

Take a look how you did the function headers below.

[...]

 +static int st_dwc3_drd_init(struct st_dwc3 *dwc3_data)
 +{
 + u32 val;
 + int err;
 +
 + err = regmap_read(dwc3_data-regmap, dwc3_data-syscfg_reg_off, val);
 + if (err)
 + return err;
 +
 + switch (dwc3_data-dr_mode) {
 + case USB_DR_MODE_PERIPHERAL:
 + val |= USB_SET_PORT_DEVICE;
 + dev_dbg(dwc3_data-dev, Configuring as Device\n);
 + break;
 +
 + case USB_DR_MODE_HOST:
 + val = USB_HOST_DEFAULT_MASK;
 + dev_dbg(dwc3_data-dev, Configuring as Host\n);
 + break;
 +
 + default:
 + dev_err(dwc3_data-dev, Unsupported mode of operation %d\n
 + , dwc3_data-dr_mode);

',' should be on the line above.

 + return -EINVAL;
 + }
 +
 + return regmap_write(dwc3_data-regmap, dwc3_data-syscfg_reg_off, val);
 +}

All of this stuff is pretty minor.

Once fixed apply my Ack on the next revision:

Acked-by: Lee Jones lee.jo...@linaro.org

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-22 Thread Lee Jones
 Thanks for reviewing, see my comments inline below: -

In future, it's best to only reply to questions, or review comments
that you disagree with.  Anything that you will action or agree with
can be snipped along with any irrelevant code from your reply and
replaced with snip or [...].  If you are planning on actioning
everything and no not disagree with anything there's no need to reply
at all.

[...]

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-22 Thread Lee Jones
+static void st_dwc3_init(struct st_dwc3 *dwc3_data)
+{
+   u32 reg = st_dwc3_readl(dwc3_data-glue_base, USB2_CLKRST_CTRL);
+
+   reg |= aux_clk_en(1) | ext_cfg_reset_n(1) | xhci_revision(1);
+   reg = ~sw_pipew_reset_n(1);
   
   1?  Better to add defines for these magic numbers.  What is 1 anyway?
  
  They are just bit setting macros, I've converted them over to use BIT macro 
  now,
  so it no longer takes a parameter.
 
 the macros are better, but make them upper case as everybody else.

When you say that the macros are better, what do you mean?

Defines do the job in a manner which is a great deal cleaner:

#define AUX_CLK_ENBIT(0)
#define SW_PIPEW_RESET_N  BIT(4)
#define EXT_CFG_RESET_N   BIT(8)
#define XHCI_REVISION BIT(12)

reg = AUX_CLK_EN | SW_PIPEW_RESET_N | XHCI_REVISION;
reg = ~SW_PIPEW_RESET_N

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-22 Thread Lee Jones
On Tue, 22 Jul 2014, Felipe Balbi wrote:

 On Tue, Jul 22, 2014 at 04:45:03PM +0100, Lee Jones wrote:
  +static void st_dwc3_init(struct st_dwc3 *dwc3_data)
  +{
  +   u32 reg = st_dwc3_readl(dwc3_data-glue_base, USB2_CLKRST_CTRL);
  +
  +   reg |= aux_clk_en(1) | ext_cfg_reset_n(1) | xhci_revision(1);
  +   reg = ~sw_pipew_reset_n(1);
 
 1?  Better to add defines for these magic numbers.  What is 1 anyway?

They are just bit setting macros, I've converted them over to use BIT 
macro now,
so it no longer takes a parameter.
   
   the macros are better, but make them upper case as everybody else.
  
  When you say that the macros are better, what do you mean?
  
  Defines do the job in a manner which is a great deal cleaner:
  
  #define AUX_CLK_ENBIT(0)
  #define SW_PIPEW_RESET_N  BIT(4)
  #define EXT_CFG_RESET_N   BIT(8)
  #define XHCI_REVISION BIT(12)
  
  reg = AUX_CLK_EN | SW_PIPEW_RESET_N | XHCI_REVISION;
  reg = ~SW_PIPEW_RESET_N
 
 this is what I meant ;-) I see what I wrote can be very ambiguous :-p

Okay great, thanks for clarifying. :)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

2014-07-10 Thread Lee Jones
On Thu, 10 Jul 2014, Felipe Balbi wrote:

 On Tue, Jul 08, 2014 at 08:53:32AM +0100, Lee Jones wrote:
  On Tue, 08 Jul 2014, Maxime Coquelin wrote:
   On 07/05/2014 08:25 AM, Peter Griffin wrote:
   Signed-off-by: Peter Griffin peter.grif...@linaro.org
   
   Acked-by: Maxime Coquelin maxime.coque...@st.com
  
  Maxime,
Once Acked by Felipe, I think this should go in via your tree to
  avoid conflicts with other ARM/STI ARCHITECTURE additions.
 
 there are still many unresolved comments on patches 1 and 2.

Once Acked ;)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

2014-07-08 Thread Lee Jones
On Tue, 08 Jul 2014, Maxime Coquelin wrote:
 On 07/05/2014 08:25 AM, Peter Griffin wrote:
 Signed-off-by: Peter Griffin peter.grif...@linaro.org
 
 Acked-by: Maxime Coquelin maxime.coque...@st.com

Maxime,
  Once Acked by Felipe, I think this should go in via your tree to
avoid conflicts with other ARM/STI ARCHITECTURE additions.

 ---
   MAINTAINERS | 1 +
   1 file changed, 1 insertion(+)
 
 diff --git a/MAINTAINERS b/MAINTAINERS
 index 702ca10..269ad3b 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -1325,6 +1325,7 @@ F: drivers/pinctrl/pinctrl-st.c
   F: drivers/media/rc/st_rc.c
   F: drivers/i2c/busses/i2c-st.c
   F: drivers/tty/serial/st-asc.c
 +F:  drivers/usb/dwc3/dwc3-st.c
 
   ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
   M: Lennert Buytenhek ker...@wantstofly.org
 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 3/3] MAINTAINERS: Add dwc3-st.c file to ARCH/STI architecture

2014-07-07 Thread Lee Jones
On Sat, 05 Jul 2014, Peter Griffin wrote:
 Signed-off-by: Peter Griffin peter.grif...@linaro.org
 ---
  MAINTAINERS | 1 +
  1 file changed, 1 insertion(+)

Acked-by: Lee Jones lee.jo...@linaro.org

 diff --git a/MAINTAINERS b/MAINTAINERS
 index 702ca10..269ad3b 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -1325,6 +1325,7 @@ F:  drivers/pinctrl/pinctrl-st.c
  F:   drivers/media/rc/st_rc.c
  F:   drivers/i2c/busses/i2c-st.c
  F:   drivers/tty/serial/st-asc.c
 +F:   drivers/usb/dwc3/dwc3-st.c
  
  ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
  M:   Lennert Buytenhek ker...@wantstofly.org

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/3] ARM: dts: sti: Add st-dwc3 devicetree bindings documentation

2014-07-07 Thread Lee Jones
Subject is wrong, this has nothing to do with ARM.  Should be USB.

On Sat, 05 Jul 2014, Peter Griffin wrote:
 This patch documents the device tree documentation required for
 the ST usb3 controller glue layer found in STiH407 devices.
 
 Signed-off-by: Giuseppe Cavallaro peppe.cavall...@st.com
 Signed-off-by: Peter Griffin peter.grif...@linaro.org
 ---
  Documentation/devicetree/bindings/usb/dwc3-st.txt | 58 
 +++
  1 file changed, 58 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/usb/dwc3-st.txt
 
 diff --git a/Documentation/devicetree/bindings/usb/dwc3-st.txt 
 b/Documentation/devicetree/bindings/usb/dwc3-st.txt
 new file mode 100644
 index 000..befd964
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/usb/dwc3-st.txt
 @@ -0,0 +1,58 @@
 +ST DWC3 glue logic
 +
 +This file documents the parameters for the dwc3-st driver.

Does this line really add anything to do the document, considering the
name and location of the file and the title above?

 +This driver provides the glue logic to use the dwc3 on STiH407 based 
 platforms.

s/This driver/The DWC2 driver/

 +Required properties:
 + - compatible: must be st,stih407-dwc3
 + - reg   : glue logic base address and USB syscfg ctrl register 
 offset
 + - reg-names : should be reg-glue and syscfg-reg

Any reason why you have reg-* and *-reg?  If  you have to put 'reg' in
the name, it's usually appended, rather than prefixed.

 + - st,syscon : should be phandle to system configuration node which
 +   encompasses the glue registers
 + - resets: phandle pointing to the system powerdown controller
 +See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
 +See: Documentation/devicetree/bindings/reset/reset.txt
 +
 + - #address-cells, #size-cells : should be '1' if the device has sub-nodes
 + with 'reg' property
 +
 + - pinctl-names  : A pinctrl state named default must be defined
 +See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
 +
 + - pinctrl-0 : Pin control group
 +See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
 +
 + - ranges: allows valid 1:1 translation between child's address space and
 +   parent's address space
 +
 +Optional properties:
 + - st,dwc3-drd-device: to program the HC as device (static setup)

This will require a DT Ack.

 +Sub-nodes:
 +The dwc3 core should be added as subnode to ST DWC3 glue as shown in the
 +example below. The DT binding details of dwc3 can be found in:
 +Documentation/devicetree/bindings/usb/dwc3.txt
 +
 +Example:
 +
 +st_dwc3: dwc3@8f94000 {
 + status  = disabled;

Probably not good to disable the node in the example.

 + compatible  = st,stih407-dwc3;
 + reg = 0x08f94000 0x1000, 0x110 0x4;
 + reg-names   = reg-glue, syscfg-reg;
 + st,syscfg   = syscfg_core;
 + resets  = powerdown STIH407_USB3_POWERDOWN;
 + #address-cells  = 1;
 + #size-cells = 1;
 + pinctrl-names   = default;
 + pinctrl-0   = pinctrl_usb3;
 + ranges;
 +
 + dwc3: dwc3@990 {
 + compatible  = synopsys,dwc3;
 + reg = 0x0990 0x10;
 + interrupts  =  GIC_SPI 155 IRQ_TYPE_NONE;
 +
 + usb-phy = usb2_phy, usb3_phy;
 + };
 +};

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC

2014-07-07 Thread Lee Jones
, syscfg-reg offset 0x%x\n,
 +  dwc3_data-glue_base, dwc3_data-syscfg_reg_off);

I think this should be removed.  At the very least downgraded to
dev_dbg().

 + dwc3_data-rstc_pwrdn = devm_reset_control_get(dwc3_data-dev, NULL);
 + if (IS_ERR(dwc3_data-rstc_pwrdn)) {
 + dev_err(pdev-dev, could not get reset controller\n);
 + ret = PTR_ERR(dwc3_data-rstc_pwrdn);
 + goto undo_platform_dev_alloc;
 + }
 +
 + /* Manage PowerDown */
 + reset_control_deassert(dwc3_data-rstc_pwrdn);
 +
 + st_dwc3_dt_get_pdata(pdev, dwc3_data);

As there is only one line in this function and this driver is DT only,
I would bring that line directly into .probe().

 + /* Allocate and initialize the core */
 + ret = of_platform_populate(node, NULL, NULL, dev);
 + if (ret) {
 + dev_err(dev, failed to add dwc3 core\n);
 + goto undo_powerdown;
 + }
 +
 + /*
 +  * Configure the USB port as device or host according to the static
 +  * configuration passed from the platform.
 +  * DRD is the only mode currently supported so this will be enhanced
 +  * later as soon as OTG will be available.
 +  */
 + ret = st_dwc3_drd_init(dwc3_data);
 + if (ret) {
 + dev_err(dev, st_dwc3_drd_init failed\n);

I wouldn't have names of functions in the kernel log.

Swap out for something like initialisation failed\n

 + goto undo_powerdown;
 + }
 +
 + dev_info(pdev-dev, configured as %s DRD\n,
 +  dwc3_data-drd_device_conf ? device : host);
 +
 + /* ST glue logic init */
 + st_dwc3_init(dwc3_data);

Can this fail?

 + ret = platform_device_add_resources(dwc3_data-dwc3, pdev-resource,
 + pdev-num_resources);
 + if (ret) {
 + dev_err(pdev-dev, couldn't add resources to dwc3 device\n);
 + goto undo_powerdown;
 + }
 +
 + ret = platform_device_add(dwc3_data-dwc3);
 + if (ret) {
 + dev_err(pdev-dev, failed to register dwc3 device\n);
 + goto undo_powerdown;
 + }
 +
 + platform_set_drvdata(pdev, dwc3_data);
 +
 + return 0;
 +
 +undo_powerdown:
 + reset_control_assert(dwc3_data-rstc_pwrdn);
 +undo_platform_dev_alloc:
 + platform_device_put(pdev);
 +
 + return ret;
 +

Remove the '\n' here.

 +}
 +
 +static int st_dwc3_remove(struct platform_device *pdev)
 +{
 + struct st_dwc3 *dwc3_data = platform_get_drvdata(pdev);
 +
 + platform_device_unregister(dwc3_data-dwc3);
 +
 + return 0;
 +}
 +
 +#ifdef CONFIG_PM_SLEEP
 +static int st_dwc3_suspend(struct device *dev)
 +{
 + struct st_dwc3 *dwc3_data = dev_get_drvdata(dev);
 +
 + reset_control_assert(dwc3_data-rstc_pwrdn);
 +
 + pinctrl_pm_select_sleep_state(dev);
 +
 + return 0;
 +}
 +
 +static int st_dwc3_resume(struct device *dev)
 +{
 + struct st_dwc3 *dwc3_data = dev_get_drvdata(dev);
 +
 + pinctrl_pm_select_default_state(dev);
 +
 + reset_control_deassert(dwc3_data-rstc_pwrdn);
 +
 + return 0;
 +}
 +

Remove the '\n' here.

 +#endif /* CONFIG_PM_SLEEP */
 +
 +static const struct dev_pm_ops st_dwc3_dev_pm_ops = {
 + SET_SYSTEM_SLEEP_PM_OPS(st_dwc3_suspend, st_dwc3_resume)
 +};

Use SIMPLE_DEV_PM_OPS().

 +static struct of_device_id st_dwc3_match[] = {
 + { .compatible = st,stih407-dwc3 },
 + { /* sentinel */ },
 +};
 +
 +MODULE_DEVICE_TABLE(of, st_dwc3_match);
 +
 +static struct platform_driver st_dwc3_driver = {
 + .probe = st_dwc3_probe,
 + .remove = st_dwc3_remove,
 + .driver = {
 + .name = usb-st-dwc3,
 + .owner = THIS_MODULE,

This is done for you elese where, you can remove.

 + .of_match_table = of_match_ptr(st_dwc3_match),
 + .pm = st_dwc3_dev_pm_ops,
 + },
 +};
 +
 +module_platform_driver(st_dwc3_driver);
 +
 +MODULE_AUTHOR(Giuseppe Cavallaro peppe.cavall...@st.com);
 +MODULE_DESCRIPTION(DesignWare USB3 STi Glue Layer);
 +MODULE_LICENSE(GPL v2);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 2/6] regulator: palmas: Rename reg_info to palmas_reg_info

2014-07-01 Thread Lee Jones
On Mon, 30 Jun 2014, Nishanth Menon wrote:

 reg_info is a generic term which might cause conflict at a later point
 in time. To prevent such a thing from occuring in future, rename to
 palmas_reg_info.
 
 Signed-off-by: Nishanth Menon n...@ti.com
 ---
  drivers/regulator/palmas-regulator.c |4 ++--
  include/linux/mfd/palmas.h   |4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)

Acked-by: Lee Jones lee.jo...@linaro.org

 diff --git a/drivers/regulator/palmas-regulator.c 
 b/drivers/regulator/palmas-regulator.c
 index 91f60fa..05f11b9 100644
 --- a/drivers/regulator/palmas-regulator.c
 +++ b/drivers/regulator/palmas-regulator.c
 @@ -41,7 +41,7 @@ static const struct regulator_linear_range 
 smps_high_ranges[] = {
   REGULATOR_LINEAR_RANGE(330, 0x7A, 0x7f, 0),
  };
  
 -static struct regs_info palmas_regs_info[] = {
 +static struct palmas_regs_info palmas_regs_info[] = {
   {
   .name   = SMPS12,
   .sname  = smps1-in,
 @@ -227,7 +227,7 @@ static struct regs_info palmas_regs_info[] = {
   },
  };
  
 -static struct regs_info tps65917_regs_info[] = {
 +static struct palmas_regs_info tps65917_regs_info[] = {
   {
   .name   = SMPS1,
   .sname  = smps1-in,
 diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
 index 1a045ba..fb0390a 100644
 --- a/include/linux/mfd/palmas.h
 +++ b/include/linux/mfd/palmas.h
 @@ -102,7 +102,7 @@ struct palmas_sleep_requestor_info {
   int bit_pos;
  };
  
 -struct regs_info {
 +struct palmas_regs_info {
   char*name;
   char*sname;
   u8  vsel_addr;
 @@ -117,7 +117,7 @@ struct palmas_pmic_driver_data {
   int ldo_begin;
   int ldo_end;
   int max_reg;
 - struct regs_info *palmas_regs_info;
 + struct palmas_regs_info *palmas_regs_info;
   struct of_regulator_match *palmas_matches;
   struct palmas_sleep_requestor_info *sleep_req_info;
   int (*smps_register)(struct palmas_pmic *pmic,

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 7/9] regulator: palmas: Add palmas_pmic_driver_data structure

2014-06-27 Thread Lee Jones
On Wed, 18 Jun 2014, Keerthy wrote:

 Add palmas_pmic_driver_data structure.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
  include/linux/mfd/palmas.h |   25 +
  1 file changed, 25 insertions(+)
 
 diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
 index 0136e58..1a045ba 100644
 --- a/include/linux/mfd/palmas.h
 +++ b/include/linux/mfd/palmas.h
 @@ -53,6 +53,8 @@ struct palmas_pmic;
  struct palmas_gpadc;
  struct palmas_resource;
  struct palmas_usb;
 +struct palmas_pmic_driver_data;
 +struct palmas_pmic_platform_data;

Are you sure all of these forward declarations are required?  I'd
prefer that you re-ordered the header file, rather than have them all
looming here.

  enum palmas_usb_state {
   PALMAS_USB_STATE_DISCONNECT,
 @@ -76,6 +78,8 @@ struct palmas {
   struct mutex irq_lock;
   struct regmap_irq_chip_data *irq_data;
  
 + struct palmas_pmic_driver_data *pmic_ddata;
 +
   /* Child Devices */
   struct palmas_pmic *pmic;
   struct palmas_gpadc *gpadc;
 @@ -107,6 +111,27 @@ struct regs_info {
   int sleep_id;
  };
  
 +struct palmas_pmic_driver_data {
 + int smps_start;
 + int smps_end;
 + int ldo_begin;
 + int ldo_end;
 + int max_reg;
 + struct regs_info *palmas_regs_info;
 + struct of_regulator_match *palmas_matches;
 + struct palmas_sleep_requestor_info *sleep_req_info;
 + int (*smps_register)(struct palmas_pmic *pmic,
 +  struct palmas_pmic_driver_data *ddata,
 +  struct palmas_pmic_platform_data *pdata,
 +  const char *pdev_name,
 +  struct regulator_config config);
 + int (*ldo_register)(struct palmas_pmic *pmic,
 + struct palmas_pmic_driver_data *ddata,
 + struct palmas_pmic_platform_data *pdata,
 + const char *pdev_name,
 + struct regulator_config config);
 +};
 +
  struct palmas_gpadc_platform_data {
   /* Channel 3 current source is only enabled during conversion */
   int ch3_current;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 8/9] regulator: palmas: add driver data and modularize the probe

2014-06-27 Thread Lee Jones
On Wed, 18 Jun 2014, Keerthy wrote:
 add driver data and modularize the probe.

Nit: This is a sentence, it should start with a capital letter.

 Signed-off-by: Keerthy j-keer...@ti.com
 ---
 
 Changes in V2:
 
   * Fixed the order of variable declarations.
 
  drivers/mfd/palmas.c |   44 +--
  drivers/regulator/palmas-regulator.c |  658 
 --
  2 files changed, 396 insertions(+), 306 deletions(-)
 
 diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
 index c12759d..28cb048 100644
 --- a/drivers/mfd/palmas.c
 +++ b/drivers/mfd/palmas.c
 @@ -25,42 +25,6 @@
  #include linux/mfd/palmas.h
  #include linux/of_device.h
  
 -#define EXTERNAL_REQUESTOR(_id, _offset, _pos)   \
 - [PALMAS_EXTERNAL_REQSTR_ID_##_id] = {   \
 - .id = PALMAS_EXTERNAL_REQSTR_ID_##_id,  \
 - .reg_offset = _offset,  \
 - .bit_pos = _pos,\
 - }
 -
 -static struct palmas_sleep_requestor_info sleep_req_info[] = {
 - EXTERNAL_REQUESTOR(REGEN1, 0, 0),
 - EXTERNAL_REQUESTOR(REGEN2, 0, 1),
 - EXTERNAL_REQUESTOR(SYSEN1, 0, 2),
 - EXTERNAL_REQUESTOR(SYSEN2, 0, 3),
 - EXTERNAL_REQUESTOR(CLK32KG, 0, 4),
 - EXTERNAL_REQUESTOR(CLK32KGAUDIO, 0, 5),
 - EXTERNAL_REQUESTOR(REGEN3, 0, 6),
 - EXTERNAL_REQUESTOR(SMPS12, 1, 0),
 - EXTERNAL_REQUESTOR(SMPS3, 1, 1),
 - EXTERNAL_REQUESTOR(SMPS45, 1, 2),
 - EXTERNAL_REQUESTOR(SMPS6, 1, 3),
 - EXTERNAL_REQUESTOR(SMPS7, 1, 4),
 - EXTERNAL_REQUESTOR(SMPS8, 1, 5),
 - EXTERNAL_REQUESTOR(SMPS9, 1, 6),
 - EXTERNAL_REQUESTOR(SMPS10, 1, 7),
 - EXTERNAL_REQUESTOR(LDO1, 2, 0),
 - EXTERNAL_REQUESTOR(LDO2, 2, 1),
 - EXTERNAL_REQUESTOR(LDO3, 2, 2),
 - EXTERNAL_REQUESTOR(LDO4, 2, 3),
 - EXTERNAL_REQUESTOR(LDO5, 2, 4),
 - EXTERNAL_REQUESTOR(LDO6, 2, 5),
 - EXTERNAL_REQUESTOR(LDO7, 2, 6),
 - EXTERNAL_REQUESTOR(LDO8, 2, 7),
 - EXTERNAL_REQUESTOR(LDO9, 3, 0),
 - EXTERNAL_REQUESTOR(LDOLN, 3, 1),
 - EXTERNAL_REQUESTOR(LDOUSB, 3, 2),
 -};
 -

Happy with this, good riddance.

  static const struct regmap_config palmas_regmap_config[PALMAS_NUM_CLIENTS] = 
 {
   {
   .reg_bits = 8,
 @@ -365,10 +329,10 @@ static struct regmap_irq_chip tps65917_irq_chip = {
  int palmas_ext_control_req_config(struct palmas *palmas,
   enum palmas_external_requestor_id id,  int ext_ctrl, bool enable)
  {
 + struct palmas_pmic_driver_data *pmic_ddata = palmas-pmic_ddata;
   int preq_mask_bit = 0;
   int reg_add = 0;
 - int bit_pos;
 - int ret;
 + int bit_pos, ret;

I don't like this change.

[...]

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/9] regulator: palmas: Add palmas_pmic_driver_data structure

2014-06-18 Thread Lee Jones
 Add palmas_pmic_driver_data structure.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
   include/linux/mfd/palmas.h |   25 +
   1 file changed, 25 insertions(+)
 
 diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
 index 8d68452..70f0695 100644
 --- a/include/linux/mfd/palmas.h
 +++ b/include/linux/mfd/palmas.h
[...]

 +struct palmas_pmic_driver_data {
 +   int smps_start;
 +   int smps_end;
 +   int ldo_begin;
 +   int ldo_end;
 +   int max_reg;
 +   struct regs_info *palmas_regs_info;
 +   struct of_regulator_match *palmas_matches;
 +   struct palmas_sleep_requestor_info *sleep_req_info;
 +   int (*smps_register)(struct palmas_pmic *pmic,
 +struct palmas_pmic_driver_data *ddata,
 +struct palmas_pmic_platform_data *pdata,
 +const char *pdev_name,
 +struct regulator_config config);
 +   int (*ldo_register)(struct palmas_pmic *pmic,
 +   struct palmas_pmic_driver_data *ddata,
 +   struct palmas_pmic_platform_data *pdata,
 +   const char *pdev_name,
 +   struct regulator_config config);
 Are you sure you need to store all of this stuff?
 
 Particularly the match pointer.  Do you really re-use it?
 
 Match pointer is used extensively in the palmas_regulator.c.
 This structure is very much used by regulator driver.

On closer inspection, I now see that it's a 'of_regulator_match',
rather than an 'of_match' pointer, which were my initial thoughts.  I
think it would have been weird to carry the 'of_match', but the
reality sounds sane.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/9] mfd: palmas: Add tps65917 specific definitions and enums

2014-06-17 Thread Lee Jones
 Add tps65917 specific definitions and enums.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
  include/linux/mfd/palmas.h |  793 
 
  1 file changed, 793 insertions(+)

Acked-by: Lee Jones lee.jo...@linaro.org

 diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
 index ccbb21f..52a24a9 100644
 --- a/include/linux/mfd/palmas.h
 +++ b/include/linux/mfd/palmas.h
 @@ -30,6 +30,8 @@
  #define PALMAS_CHIP_ID   0xC035
  #define PALMAS_CHIP_CHARGER_ID   0xC036
  
 +#define TPS65917_RESERVED-1
 +
  #define is_palmas(a) (((a) == PALMAS_CHIP_OLD_ID) || \
   ((a) == PALMAS_CHIP_ID))
  #define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID)
 @@ -184,6 +186,27 @@ enum palmas_regulators {
   PALMAS_NUM_REGS,
  };
  
 +enum tps65917_regulators {
 + /* SMPS regulators */
 + TPS65917_REG_SMPS1,
 + TPS65917_REG_SMPS2,
 + TPS65917_REG_SMPS3,
 + TPS65917_REG_SMPS4,
 + TPS65917_REG_SMPS5,
 + /* LDO regulators */
 + TPS65917_REG_LDO1,
 + TPS65917_REG_LDO2,
 + TPS65917_REG_LDO3,
 + TPS65917_REG_LDO4,
 + TPS65917_REG_LDO5,
 + TPS65917_REG_REGEN1,
 + TPS65917_REG_REGEN2,
 + TPS65917_REG_REGEN3,
 +
 + /* Total number of regulators */
 + TPS65917_NUM_REGS,
 +};
 +
  /* External controll signal name */
  enum {
   PALMAS_EXT_CONTROL_ENABLE1  = 0x1,
 @@ -228,6 +251,24 @@ enum palmas_external_requestor_id {
   PALMAS_EXTERNAL_REQSTR_ID_MAX,
  };
  
 +enum tps65917_external_requestor_id {
 + TPS65917_EXTERNAL_REQSTR_ID_REGEN1,
 + TPS65917_EXTERNAL_REQSTR_ID_REGEN2,
 + TPS65917_EXTERNAL_REQSTR_ID_REGEN3,
 + TPS65917_EXTERNAL_REQSTR_ID_SMPS1,
 + TPS65917_EXTERNAL_REQSTR_ID_SMPS2,
 + TPS65917_EXTERNAL_REQSTR_ID_SMPS3,
 + TPS65917_EXTERNAL_REQSTR_ID_SMPS4,
 + TPS65917_EXTERNAL_REQSTR_ID_SMPS5,
 + TPS65917_EXTERNAL_REQSTR_ID_LDO1,
 + TPS65917_EXTERNAL_REQSTR_ID_LDO2,
 + TPS65917_EXTERNAL_REQSTR_ID_LDO3,
 + TPS65917_EXTERNAL_REQSTR_ID_LDO4,
 + TPS65917_EXTERNAL_REQSTR_ID_LDO5,
 + /* Last entry */
 + TPS65917_EXTERNAL_REQSTR_ID_MAX,
 +};
 +
  struct palmas_pmic_platform_data {
   /* An array of pointers to regulator init data indexed by regulator
* ID
 @@ -349,6 +390,48 @@ struct palmas_gpadc_result {
  
  #define PALMAS_MAX_CHANNELS 16
  
 +/* Define the tps65917 IRQ numbers */
 +enum tps65917_irqs {
 + /* INT1 registers */
 + TPS65917_RESERVED1,
 + TPS65917_PWRON_IRQ,
 + TPS65917_LONG_PRESS_KEY_IRQ,
 + TPS65917_RESERVED2,
 + TPS65917_PWRDOWN_IRQ,
 + TPS65917_HOTDIE_IRQ,
 + TPS65917_VSYS_MON_IRQ,
 + TPS65917_RESERVED3,
 + /* INT2 registers */
 + TPS65917_RESERVED4,
 + TPS65917_OTP_ERROR_IRQ,
 + TPS65917_WDT_IRQ,
 + TPS65917_RESERVED5,
 + TPS65917_RESET_IN_IRQ,
 + TPS65917_FSD_IRQ,
 + TPS65917_SHORT_IRQ,
 + TPS65917_RESERVED6,
 + /* INT3 registers */
 + TPS65917_GPADC_AUTO_0_IRQ,
 + TPS65917_GPADC_AUTO_1_IRQ,
 + TPS65917_GPADC_EOC_SW_IRQ,
 + TPS65917_RESREVED6,
 + TPS65917_RESERVED7,
 + TPS65917_RESERVED8,
 + TPS65917_RESERVED9,
 + TPS65917_VBUS_IRQ,
 + /* INT4 registers */
 + TPS65917_GPIO_0_IRQ,
 + TPS65917_GPIO_1_IRQ,
 + TPS65917_GPIO_2_IRQ,
 + TPS65917_GPIO_3_IRQ,
 + TPS65917_GPIO_4_IRQ,
 + TPS65917_GPIO_5_IRQ,
 + TPS65917_GPIO_6_IRQ,
 + TPS65917_RESERVED10,
 + /* Total Number IRQs */
 + TPS65917_NUM_IRQ,
 +};
 +
  /* Define the palmas IRQ numbers */
  enum palmas_irqs {
   /* INT1 registers */
 @@ -400,6 +483,7 @@ struct palmas_pmic {
  
   int smps123;
   int smps457;
 + int smps12;
  
   int range[PALMAS_REG_SMPS10_OUT1];
   unsigned int ramp_delay[PALMAS_REG_SMPS10_OUT1];
 @@ -2871,6 +2955,715 @@ enum usb_irq_events {
  #define PALMAS_GPADC_TRIM15  0x0E
  #define PALMAS_GPADC_TRIM16  0x0F
  
 +/* TPS65917 Interrupt registers */
 +
 +/* Registers for function INTERRUPT */
 +#define TPS65917_INT1_STATUS 0x00
 +#define TPS65917_INT1_MASK   0x01
 +#define TPS65917_INT1_LINE_STATE 0x02
 +#define TPS65917_INT2_STATUS 0x05
 +#define TPS65917_INT2_MASK   0x06
 +#define TPS65917_INT2_LINE_STATE 0x07
 +#define TPS65917_INT3_STATUS 0x0A
 +#define TPS65917_INT3_MASK   0x0B
 +#define TPS65917_INT3_LINE_STATE 0x0C
 +#define TPS65917_INT4_STATUS 0x0F
 +#define TPS65917_INT4_MASK   0x10
 +#define TPS65917_INT4_LINE_STATE 0x11
 +#define TPS65917_INT4_EDGE_DETECT1

Re: [PATCH 4/9] mfd: palmas: Add tps65917 support

2014-06-17 Thread Lee Jones
 Add tps65917 PMIC support. tps65917 is a subset of palmas PMIC.
 Some of the register definitions and the interrupt mappings
 are different.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
  drivers/mfd/palmas.c |  176 
 --
  1 file changed, 171 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
 index d280d78..485d755 100644
 --- a/drivers/mfd/palmas.c
 +++ b/drivers/mfd/palmas.c

[...]

 +struct palmas_driver_data {
 + unsigned int *features;
 + struct regmap_irq_chip *irq_chip;
 +};
 +
 +static struct palmas_driver_data palmas_data = {
 + .features = palmas_features,
 + .irq_chip = palmas_irq_chip,
 +};
 +
 +static struct palmas_driver_data tps659038_data = {
 + .features = tps659038_features,
 + .irq_chip = palmas_irq_chip,
 +};
 +
 +static struct palmas_driver_data tps65917_data = {
 + .features = tps659038_features,
 + .irq_chip = tps65917_irq_chip,
 +};
 +

[...]

 @@ -375,6 +539,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
  {
   struct palmas *palmas;
   struct palmas_platform_data *pdata;
 + struct palmas_driver_data *driver_data;
   struct device_node *node = i2c-dev.of_node;
   int ret = 0, i;
   unsigned int reg, addr, *features;
 @@ -408,7 +573,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
   if (!match)
   return -ENODATA;
  
 - features = (unsigned int *)match-data;
 + driver_data = (struct palmas_driver_data *)match-data;
 + features = (unsigned int *)driver_data-features;
   palmas-features = *features;

Couple of things a) I don't think the cast is required here and b) you
may as well do away with the local features variable here.

Just do:
  palmas-features = *driver_data-features;

Once fixed, re-submit with my:
  Acked-by: Lee Jones lee.jo...@linaro.org

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/9] regulator: palmas: Shift the reg_info structure definition to the header file

2014-06-17 Thread Lee Jones
On Wed, 28 May 2014, Keerthy wrote:

 Shift the reg_info structure definition to the header file.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
  drivers/regulator/palmas-regulator.c |9 -
  include/linux/mfd/palmas.h   |9 +
  2 files changed, 9 insertions(+), 9 deletions(-)

Patch looks fine.  I guess we'll wait and pull the entire set in once
it's ready.

Acked-by: Lee Jones lee.jo...@linaro.org

 diff --git a/drivers/regulator/palmas-regulator.c 
 b/drivers/regulator/palmas-regulator.c
 index 9602eba..d41f3de 100644
 --- a/drivers/regulator/palmas-regulator.c
 +++ b/drivers/regulator/palmas-regulator.c
 @@ -27,15 +27,6 @@
  #include linux/of_platform.h
  #include linux/regulator/of_regulator.h
  
 -struct regs_info {
 - char*name;
 - char*sname;
 - u8  vsel_addr;
 - u8  ctrl_addr;
 - u8  tstep_addr;
 - int sleep_id;
 -};
 -
  static const struct regulator_linear_range smps_low_ranges[] = {
   REGULATOR_LINEAR_RANGE(50, 0x1, 0x6, 0),
   REGULATOR_LINEAR_RANGE(51, 0x7, 0x79, 1),
 diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
 index 52a24a9..150a6314 100644
 --- a/include/linux/mfd/palmas.h
 +++ b/include/linux/mfd/palmas.h
 @@ -88,6 +88,15 @@ struct palmas {
   u8 pwm_muxed;
  };
  
 +struct regs_info {
 + char*name;
 + char*sname;
 + u8  vsel_addr;
 + u8  ctrl_addr;
 + u8  tstep_addr;
 + int sleep_id;
 +};
 +
  struct palmas_gpadc_platform_data {
   /* Channel 3 current source is only enabled during conversion */
   int ch3_current;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/9] mfd: palmas: shift the palmas_sleep_requestor_info structure definition to the header file

2014-06-17 Thread Lee Jones
On Wed, 28 May 2014, Keerthy wrote:

 shift the palmas_sleep_requestor_info structure definition to the header file.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
  drivers/mfd/palmas.c   |   10 --
  include/linux/mfd/palmas.h |   10 ++
  2 files changed, 10 insertions(+), 10 deletions(-)

Acked-by: Lee Jones lee.jo...@linaro.org

 diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
 index 485d755..f1f31d5 100644
 --- a/drivers/mfd/palmas.c
 +++ b/drivers/mfd/palmas.c
 @@ -25,16 +25,6 @@
  #include linux/mfd/palmas.h
  #include linux/of_device.h
  
 -#define PALMAS_EXT_REQ (PALMAS_EXT_CONTROL_ENABLE1 | \
 - PALMAS_EXT_CONTROL_ENABLE2 |\
 - PALMAS_EXT_CONTROL_NSLEEP)
 -
 -struct palmas_sleep_requestor_info {
 - int id;
 - int reg_offset;
 - int bit_pos;
 -};
 -
  #define EXTERNAL_REQUESTOR(_id, _offset, _pos)   \
   [PALMAS_EXTERNAL_REQSTR_ID_##_id] = {   \
   .id = PALMAS_EXTERNAL_REQSTR_ID_##_id,  \
 diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
 index 150a6314..8d68452 100644
 --- a/include/linux/mfd/palmas.h
 +++ b/include/linux/mfd/palmas.h
 @@ -88,6 +88,16 @@ struct palmas {
   u8 pwm_muxed;
  };
  
 +#define PALMAS_EXT_REQ (PALMAS_EXT_CONTROL_ENABLE1 | \
 + PALMAS_EXT_CONTROL_ENABLE2 |\
 + PALMAS_EXT_CONTROL_NSLEEP)
 +
 +struct palmas_sleep_requestor_info {
 + int id;
 + int reg_offset;
 + int bit_pos;
 +};
 +
  struct regs_info {
   char*name;
   char*sname;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/9] regulator: palmas: Add palmas_pmic_driver_data structure

2014-06-17 Thread Lee Jones
On Wed, 28 May 2014, Keerthy wrote:

 Add palmas_pmic_driver_data structure.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
  include/linux/mfd/palmas.h |   25 +
  1 file changed, 25 insertions(+)
 
 diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
 index 8d68452..70f0695 100644
 --- a/include/linux/mfd/palmas.h
 +++ b/include/linux/mfd/palmas.h
 @@ -53,6 +53,8 @@ struct palmas_pmic;
  struct palmas_gpadc;
  struct palmas_resource;
  struct palmas_usb;
 +struct palmas_pmic_driver_data;
 +struct palmas_pmic_platform_data;
  
  enum palmas_usb_state {
   PALMAS_USB_STATE_DISCONNECT,
 @@ -76,6 +78,8 @@ struct palmas {
   struct mutex irq_lock;
   struct regmap_irq_chip_data *irq_data;
  
 + struct palmas_pmic_driver_data *pmic_ddata;
 +
   /* Child Devices */
   struct palmas_pmic *pmic;
   struct palmas_gpadc *gpadc;
 @@ -107,6 +111,27 @@ struct regs_info {
   int sleep_id;
  };
  
 +struct palmas_pmic_driver_data {
 + int smps_start;
 + int smps_end;
 + int ldo_begin;
 + int ldo_end;
 + int max_reg;
 + struct regs_info *palmas_regs_info;
 + struct of_regulator_match *palmas_matches;
 + struct palmas_sleep_requestor_info *sleep_req_info;
 + int (*smps_register)(struct palmas_pmic *pmic,
 +  struct palmas_pmic_driver_data *ddata,
 +  struct palmas_pmic_platform_data *pdata,
 +  const char *pdev_name,
 +  struct regulator_config config);
 + int (*ldo_register)(struct palmas_pmic *pmic,
 + struct palmas_pmic_driver_data *ddata,
 + struct palmas_pmic_platform_data *pdata,
 + const char *pdev_name,
 + struct regulator_config config);

Are you sure you need to store all of this stuff?

Particularly the match pointer.  Do you really re-use it?

 +};
 +
  struct palmas_gpadc_platform_data {
   /* Channel 3 current source is only enabled during conversion */
   int ch3_current;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 8/9] regulator: palmas: add driver data and modularize the probe

2014-06-17 Thread Lee Jones
 add driver data and modularize the probe.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
  drivers/mfd/palmas.c |   42 +--
  drivers/regulator/palmas-regulator.c |  656 
 --
  2 files changed, 395 insertions(+), 303 deletions(-)
 
 diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c

[...]

 @@ -370,6 +334,8 @@ int palmas_ext_control_req_config(struct palmas *palmas,
   int bit_pos;
   int ret;
  
 + struct palmas_pmic_driver_data *pmic_ddata = palmas-pmic_ddata;
 +

Nit: I'd prefer the declarations to be grouped together, normally with
the struct defines above the ints etc.

[...]

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] mfd: Immutable branch between MFD and OMAP, due for v3.16

2014-06-16 Thread Lee Jones
Still not seeing this branch being merged..
   
   Oh crap, I see what's happened and it's completely my fault.
   
   If you read the final merge commit carefully:
   
   28fee3f: (Merge branches 'ib-from-asoc-3.16', 'ib-from-pm-3.16',
   'ib-from-regulator-3.16', 'ib-mfd-gpio-3.16' and
   'ib-mfd-mmc-memstick-3.16', tags 'ib-mfd-extcon-3.16',
   'ib-mfd-omap-3.16' and 'ib-mfd-regulator-3.16' into
   ibs-for-mfd-merged)
   
   I appear to have a _branch_ AND a _tag_ called ib-mfd-omap-3.16 and it
   looks like Git has taken the tag as a preference. heads/ib-mfd-omap-3.16
   is actually at tag/ib-mfd-omap-3.16-1 (notice the appended '-1'),
   which contains your most recent patches.  Since I created the MFD-OMAP
   shared branch I have changed the naming convention to avoid this sort
   of ambiguity.  I'll send a second MFD pull-request to Linus today.
  
  Heh OK yeah I've hit that also at some point :)
   
   Sorry Tony.
  
  No problem, good to hear you got it figured out.
 
 Pull-request sent.  Hopefully it's sorted now.

bae14e7a2dcb726476b5020396923a24ccc4c40b

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] mfd: Immutable branch between MFD and OMAP, due for v3.16

2014-06-12 Thread Lee Jones
On Wed, 11 Jun 2014, Tony Lindgren wrote:

 * Lee Jones lee.jo...@linaro.org [140603 01:08]:
  On Mon, 02 Jun 2014, Tony Lindgren wrote:
   * Tony Lindgren t...@atomide.com [140528 11:11]:
* Lee Jones lee.jo...@linaro.org [140528 00:14]:
 Thanks Tony, here's the pull-request:
 
 The following changes since commit 
 455c6fdbd219161bd09b1165f11699d6d73de11c:
 
   Linux 3.14 (2014-03-30 20:40:15 -0700)
 
 are available in the git repository at:
 
   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git 
 tags/mfd-omap-v3.16-1
 
 for you to fetch changes up to 
 43fef47f94a1ae46fb2720dada32fa3b5547bee2:
 
   mfd: twl4030-power: Add a configuration to turn off oscillator 
 during off-idle (2014-05-28 08:06:18 +0100)
 
 
 Second immutable branch between MFD and OMAP due for the v3.16 merge 
 window.

Thanks a lot, this will make it easier for me to chase down potential
PM related regressions ;) I'm merging this for testing only into the
linux-omap master branch, no need for me to include it into any
of my upstream heading branches.
   
   Lee, I'm not seeing this in linux next, did you maybe forget to merge
   it into the MFD tree?
  
  I didn't forget, but I didn't do it either. :)
  
  I have re-merged all of the IBs this morning, so should be in -next
  by tomorrow.
 
 Still not seeing this branch being merged..

Oh crap, I see what's happened and it's completely my fault.

If you read the final merge commit carefully:

28fee3f: (Merge branches 'ib-from-asoc-3.16', 'ib-from-pm-3.16',
'ib-from-regulator-3.16', 'ib-mfd-gpio-3.16' and
'ib-mfd-mmc-memstick-3.16', tags 'ib-mfd-extcon-3.16',
'ib-mfd-omap-3.16' and 'ib-mfd-regulator-3.16' into
ibs-for-mfd-merged)

I appear to have a _branch_ AND a _tag_ called ib-mfd-omap-3.16 and it
looks like Git has taken the tag as a preference. heads/ib-mfd-omap-3.16
is actually at tag/ib-mfd-omap-3.16-1 (notice the appended '-1'),
which contains your most recent patches.  Since I created the MFD-OMAP
shared branch I have changed the naming convention to avoid this sort
of ambiguity.  I'll send a second MFD pull-request to Linus today.

Sorry Tony.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] mfd: Immutable branch between MFD and OMAP, due for v3.16

2014-06-12 Thread Lee Jones
On Thu, 12 Jun 2014, Tony Lindgren wrote:

 * Lee Jones lee.jo...@linaro.org [140612 00:48]:
  On Wed, 11 Jun 2014, Tony Lindgren wrote:
  
   * Lee Jones lee.jo...@linaro.org [140603 01:08]:
On Mon, 02 Jun 2014, Tony Lindgren wrote:
 * Tony Lindgren t...@atomide.com [140528 11:11]:
  * Lee Jones lee.jo...@linaro.org [140528 00:14]:
   Thanks Tony, here's the pull-request:
   
   The following changes since commit 
   455c6fdbd219161bd09b1165f11699d6d73de11c:
   
 Linux 3.14 (2014-03-30 20:40:15 -0700)
   
   are available in the git repository at:
   
 git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git 
   tags/mfd-omap-v3.16-1
   
   for you to fetch changes up to 
   43fef47f94a1ae46fb2720dada32fa3b5547bee2:
   
 mfd: twl4030-power: Add a configuration to turn off oscillator 
   during off-idle (2014-05-28 08:06:18 +0100)
   
   
   Second immutable branch between MFD and OMAP due for the v3.16 
   merge window.
  
  Thanks a lot, this will make it easier for me to chase down 
  potential
  PM related regressions ;) I'm merging this for testing only into the
  linux-omap master branch, no need for me to include it into any
  of my upstream heading branches.
 
 Lee, I'm not seeing this in linux next, did you maybe forget to merge
 it into the MFD tree?

I didn't forget, but I didn't do it either. :)

I have re-merged all of the IBs this morning, so should be in -next
by tomorrow.
   
   Still not seeing this branch being merged..
  
  Oh crap, I see what's happened and it's completely my fault.
  
  If you read the final merge commit carefully:
  
  28fee3f: (Merge branches 'ib-from-asoc-3.16', 'ib-from-pm-3.16',
  'ib-from-regulator-3.16', 'ib-mfd-gpio-3.16' and
  'ib-mfd-mmc-memstick-3.16', tags 'ib-mfd-extcon-3.16',
  'ib-mfd-omap-3.16' and 'ib-mfd-regulator-3.16' into
  ibs-for-mfd-merged)
  
  I appear to have a _branch_ AND a _tag_ called ib-mfd-omap-3.16 and it
  looks like Git has taken the tag as a preference. heads/ib-mfd-omap-3.16
  is actually at tag/ib-mfd-omap-3.16-1 (notice the appended '-1'),
  which contains your most recent patches.  Since I created the MFD-OMAP
  shared branch I have changed the naming convention to avoid this sort
  of ambiguity.  I'll send a second MFD pull-request to Linus today.
 
 Heh OK yeah I've hit that also at some point :)
  
  Sorry Tony.
 
 No problem, good to hear you got it figured out.

Pull-request sent.  Hopefully it's sorted now.

If there are any more issues I'll sort them out as they appear, but I
may be a little slower than usual as I'm currently on holiday in Spain.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/9] mfd: tps65917: Add support for for TPS65917 PMIC

2014-06-06 Thread Lee Jones
 Hi Mark/Lee Jones,
 
 On Wednesday 28 May 2014 03:50 PM, Keerthy wrote:
 The TPS65917 chip is a power management IC for Portable Navigation Systems
 and Tablet Computing devices. It contains the following components:
 
   - Regulators.
   - GPADC.
   - Over Temperature warning and Shut down.
 
 This patch series adds support for TPS65917 mfd device. At this time only
 the regulator functionality is made available.
 
 The closest drivers are PALMAS series drivers. Hence adapted palmas mfd
 driver to support the tps65917 PMIC.
 
 The register set for SMPSs and LDOs are changed and the ramp delay support
 is also changed. Bit-field defenitions are changed.
 Hence added driver data structures for mfd and regulator drivers
 for palmas and added support for tps65917.
 
 The patches are boot tested on DRA72-EVM.
 The patches are boot tested on OMAP5-UEVM board.
 
 A gentle ping on this rework.

There's no point in pinging on any patch during the merge-window.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] mfd: Immutable branch between MFD and OMAP, due for v3.16

2014-06-03 Thread Lee Jones
On Mon, 02 Jun 2014, Tony Lindgren wrote:
 * Tony Lindgren t...@atomide.com [140528 11:11]:
  * Lee Jones lee.jo...@linaro.org [140528 00:14]:
   Thanks Tony, here's the pull-request:
   
   The following changes since commit 
   455c6fdbd219161bd09b1165f11699d6d73de11c:
   
 Linux 3.14 (2014-03-30 20:40:15 -0700)
   
   are available in the git repository at:
   
 git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git 
   tags/mfd-omap-v3.16-1
   
   for you to fetch changes up to 43fef47f94a1ae46fb2720dada32fa3b5547bee2:
   
 mfd: twl4030-power: Add a configuration to turn off oscillator during 
   off-idle (2014-05-28 08:06:18 +0100)
   
   
   Second immutable branch between MFD and OMAP due for the v3.16 merge 
   window.
  
  Thanks a lot, this will make it easier for me to chase down potential
  PM related regressions ;) I'm merging this for testing only into the
  linux-omap master branch, no need for me to include it into any
  of my upstream heading branches.
 
 Lee, I'm not seeing this in linux next, did you maybe forget to merge
 it into the MFD tree?

I didn't forget, but I didn't do it either. :)

I have re-merged all of the IBs this morning, so should be in -next
by tomorrow.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/7] mfd: twl4030-power: Enable off-idle configuration when booted with device tree

2014-05-28 Thread Lee Jones
   Here's an updated set of patches to enable low-power idle modes
   for some omap3 boards when booted with device tree.
   
   This series when applied on top of the patches in tread   
 
 
   [PATCH 00/11] Fixes for omap PM for making omap3 DT only,
   or omap-for-v3.16/pm branch.
   
   Lee, if these patches look OK to you, please feel free to 
   pick them, preferrably to the immutable branch you already
   have set up so I can also merge them in to be able to have
   things working in my branch properly for PM.
  
  Whoops, nearly forgot about this patchset.
  
  Tony, can you resend it with all your fix-ups please.  The 8 doesn't
  work well with my patch application 'system'.
 
 Sure I'll do that. FYI, these kind of patches should apply just
 fine when piped to git-am --scissors.

It's not that - the patches would apply just fine individually.
However my mailer stores the patches in date order, so when I use `git
am mbox-folder` it attempts to apply them OoO.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] mfd: Immutable branch between MFD and OMAP, due for v3.16

2014-05-28 Thread Lee Jones
Thanks Tony, here's the pull-request:

The following changes since commit 455c6fdbd219161bd09b1165f11699d6d73de11c:

  Linux 3.14 (2014-03-30 20:40:15 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git 
tags/mfd-omap-v3.16-1

for you to fetch changes up to 43fef47f94a1ae46fb2720dada32fa3b5547bee2:

  mfd: twl4030-power: Add a configuration to turn off oscillator during 
off-idle (2014-05-28 08:06:18 +0100)


Second immutable branch between MFD and OMAP due for the v3.16 merge window.


Tony Lindgren (7):
  mfd: twl-core: Fix idle mode signaling for omaps when booted with device 
tree
  mfd: twl4030-power: Fix hang on reboot if sleep configuration was loaded 
earlier
  mfd: twl4030-power: Fix some defines for SW_EVENTS
  mfd: twl4030-power: Add generic reset configuration
  mfd: twl4030-power: Add recommended idle configuration
  mfd: twl4030-power: Add support for board specific configuration
  mfd: twl4030-power: Add a configuration to turn off oscillator during 
off-idle

 .../devicetree/bindings/mfd/twl4030-power.txt  |  17 +-
 arch/arm/mach-omap2/omap_twl.c |  60 -
 drivers/mfd/twl-core.c |  15 ++
 drivers/mfd/twl4030-power.c| 286 +++--
 include/linux/i2c/twl.h|   4 +
 5 files changed, 296 insertions(+), 86 deletions(-)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] regulator: tps65917: Add Regulator driver for tps65917 PMIC

2014-05-27 Thread Lee Jones
 This patch adds support for TPS65917 PMIC regulators.
 
 The regulators set consists of 5 SMPSs and 5 LDOs. The output
 voltages are configurable and are meant to supply power to the
 main processor and other components.
 This appears to look *very* like the Palmas driver, should it not be
 sharing code with that?  If it were just data tables it'd be less of a
 concern but there's quite a bit of actual code here.
 Yes it is. The difference is in the entire register space of the regulators
 between the two. There are other differences in how the ramp delay
 is configured and SMPS ordering. The difference is also a bit in the
 programming
 sequence. I agree that largely it is Palmas based. I did not want to
 add more
 checks in the probe of the palmas driver. Hence came up with a new one.
 
 Coming to sharing the code, can we have 2 drivers which share the common
 functions with separate data and specific functions?

Yes, that is what the match functionality is for.  Once you know which
driver you're dealing with, you can call specific initialisation
functions and/or supplement generic generic data structures with device
specific ones.

 I just simply do not want to add anything more to the palmas driver
 probe function.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/5] mfd: palmas: Add tps65917 support

2014-05-27 Thread Lee Jones
On Mon, 26 May 2014, Keerthy wrote:

 Add tps65917 PMIC support. tps65917 is a subset of palmas PMIC.
 Some of the register definitions and the interrupt mappings
 are different.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
  drivers/mfd/palmas.c |  177 
 --

Much nicer.  You just saved yourself(/the subsystem) 420 lines!

I have a single nit.  Once it's fixed-up you can apply my:

  Acked-by: Lee Jones lee.jo...@linaro.org

  1 file changed, 172 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
 index d280d78..e4684cc 100644
 --- a/drivers/mfd/palmas.c
 +++ b/drivers/mfd/palmas.c

[...]

  static const struct of_device_id of_palmas_match_tbl[] = {
   {
   .compatible = ti,palmas,
 - .data = palmas_features,
 + .data = palmas_data,
   },
   {
   .compatible = ti,tps659038,
 - .data = tps659038_features,
 + .data = tps659038_data,
   },
 + {
 + .compatible = ti,tps65917,
 + .data = tps65917_data,
 + },
 +

Please get rid of this line.

   { },
  };
  MODULE_DEVICE_TABLE(of, of_palmas_match_tbl);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/5] mfd: palmas: Add tps65917 specific definitions and enums

2014-05-27 Thread Lee Jones
 Add tps65917 specific definitions and enums.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
  include/linux/mfd/palmas.h |  793 
 
  1 file changed, 793 insertions(+)

Looks okay to me:

  Acked-by: Lee Jones lee.jo...@linaro.org

Do the MFD patches have dependencies or are they depended on by the
others in the set?

 diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
 index ccbb21f..52a24a9 100644
 --- a/include/linux/mfd/palmas.h
 +++ b/include/linux/mfd/palmas.h
 @@ -30,6 +30,8 @@
  #define PALMAS_CHIP_ID   0xC035
  #define PALMAS_CHIP_CHARGER_ID   0xC036
  
 +#define TPS65917_RESERVED-1
 +
  #define is_palmas(a) (((a) == PALMAS_CHIP_OLD_ID) || \
   ((a) == PALMAS_CHIP_ID))
  #define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID)
 @@ -184,6 +186,27 @@ enum palmas_regulators {
   PALMAS_NUM_REGS,
  };
  
 +enum tps65917_regulators {
 + /* SMPS regulators */
 + TPS65917_REG_SMPS1,
 + TPS65917_REG_SMPS2,
 + TPS65917_REG_SMPS3,
 + TPS65917_REG_SMPS4,
 + TPS65917_REG_SMPS5,
 + /* LDO regulators */
 + TPS65917_REG_LDO1,
 + TPS65917_REG_LDO2,
 + TPS65917_REG_LDO3,
 + TPS65917_REG_LDO4,
 + TPS65917_REG_LDO5,
 + TPS65917_REG_REGEN1,
 + TPS65917_REG_REGEN2,
 + TPS65917_REG_REGEN3,
 +
 + /* Total number of regulators */
 + TPS65917_NUM_REGS,
 +};
 +
  /* External controll signal name */
  enum {
   PALMAS_EXT_CONTROL_ENABLE1  = 0x1,
 @@ -228,6 +251,24 @@ enum palmas_external_requestor_id {
   PALMAS_EXTERNAL_REQSTR_ID_MAX,
  };
  
 +enum tps65917_external_requestor_id {
 + TPS65917_EXTERNAL_REQSTR_ID_REGEN1,
 + TPS65917_EXTERNAL_REQSTR_ID_REGEN2,
 + TPS65917_EXTERNAL_REQSTR_ID_REGEN3,
 + TPS65917_EXTERNAL_REQSTR_ID_SMPS1,
 + TPS65917_EXTERNAL_REQSTR_ID_SMPS2,
 + TPS65917_EXTERNAL_REQSTR_ID_SMPS3,
 + TPS65917_EXTERNAL_REQSTR_ID_SMPS4,
 + TPS65917_EXTERNAL_REQSTR_ID_SMPS5,
 + TPS65917_EXTERNAL_REQSTR_ID_LDO1,
 + TPS65917_EXTERNAL_REQSTR_ID_LDO2,
 + TPS65917_EXTERNAL_REQSTR_ID_LDO3,
 + TPS65917_EXTERNAL_REQSTR_ID_LDO4,
 + TPS65917_EXTERNAL_REQSTR_ID_LDO5,
 + /* Last entry */
 + TPS65917_EXTERNAL_REQSTR_ID_MAX,
 +};
 +
  struct palmas_pmic_platform_data {
   /* An array of pointers to regulator init data indexed by regulator
* ID
 @@ -349,6 +390,48 @@ struct palmas_gpadc_result {
  
  #define PALMAS_MAX_CHANNELS 16
  
 +/* Define the tps65917 IRQ numbers */
 +enum tps65917_irqs {
 + /* INT1 registers */
 + TPS65917_RESERVED1,
 + TPS65917_PWRON_IRQ,
 + TPS65917_LONG_PRESS_KEY_IRQ,
 + TPS65917_RESERVED2,
 + TPS65917_PWRDOWN_IRQ,
 + TPS65917_HOTDIE_IRQ,
 + TPS65917_VSYS_MON_IRQ,
 + TPS65917_RESERVED3,
 + /* INT2 registers */
 + TPS65917_RESERVED4,
 + TPS65917_OTP_ERROR_IRQ,
 + TPS65917_WDT_IRQ,
 + TPS65917_RESERVED5,
 + TPS65917_RESET_IN_IRQ,
 + TPS65917_FSD_IRQ,
 + TPS65917_SHORT_IRQ,
 + TPS65917_RESERVED6,
 + /* INT3 registers */
 + TPS65917_GPADC_AUTO_0_IRQ,
 + TPS65917_GPADC_AUTO_1_IRQ,
 + TPS65917_GPADC_EOC_SW_IRQ,
 + TPS65917_RESREVED6,
 + TPS65917_RESERVED7,
 + TPS65917_RESERVED8,
 + TPS65917_RESERVED9,
 + TPS65917_VBUS_IRQ,
 + /* INT4 registers */
 + TPS65917_GPIO_0_IRQ,
 + TPS65917_GPIO_1_IRQ,
 + TPS65917_GPIO_2_IRQ,
 + TPS65917_GPIO_3_IRQ,
 + TPS65917_GPIO_4_IRQ,
 + TPS65917_GPIO_5_IRQ,
 + TPS65917_GPIO_6_IRQ,
 + TPS65917_RESERVED10,
 + /* Total Number IRQs */
 + TPS65917_NUM_IRQ,
 +};
 +
  /* Define the palmas IRQ numbers */
  enum palmas_irqs {
   /* INT1 registers */
 @@ -400,6 +483,7 @@ struct palmas_pmic {
  
   int smps123;
   int smps457;
 + int smps12;
  
   int range[PALMAS_REG_SMPS10_OUT1];
   unsigned int ramp_delay[PALMAS_REG_SMPS10_OUT1];
 @@ -2871,6 +2955,715 @@ enum usb_irq_events {
  #define PALMAS_GPADC_TRIM15  0x0E
  #define PALMAS_GPADC_TRIM16  0x0F
  
 +/* TPS65917 Interrupt registers */
 +
 +/* Registers for function INTERRUPT */
 +#define TPS65917_INT1_STATUS 0x00
 +#define TPS65917_INT1_MASK   0x01
 +#define TPS65917_INT1_LINE_STATE 0x02
 +#define TPS65917_INT2_STATUS 0x05
 +#define TPS65917_INT2_MASK   0x06
 +#define TPS65917_INT2_LINE_STATE 0x07
 +#define TPS65917_INT3_STATUS 0x0A
 +#define TPS65917_INT3_MASK   0x0B
 +#define TPS65917_INT3_LINE_STATE 0x0C
 +#define TPS65917_INT4_STATUS 0x0F
 +#define TPS65917_INT4_MASK   0x10

Re: [PATCH v2 0/7] mfd: twl4030-power: Enable off-idle configuration when booted with device tree

2014-05-27 Thread Lee Jones
 Here's an updated set of patches to enable low-power idle modes
 for some omap3 boards when booted with device tree.
 
 This series when applied on top of the patches in tread   
   
   
 [PATCH 00/11] Fixes for omap PM for making omap3 DT only,
 or omap-for-v3.16/pm branch.
 
 Lee, if these patches look OK to you, please feel free to 
 pick them, preferrably to the immutable branch you already
 have set up so I can also merge them in to be able to have
 things working in my branch properly for PM.

Whoops, nearly forgot about this patchset.

Tony, can you resend it with all your fix-ups please.  The 8 doesn't
work well with my patch application 'system'.

 Tony Lindgren (7):
   mfd: twl4030-power: Fix hang on reboot if sleep configuration was
 loaded earlier
   mfd: twl4030-power: Fix some defines for SW_EVENTS
   mfd: twl4030-power: Add generic reset configuration
   mfd: twl4030-power: Add recommended idle configuration
   mfd: twl4030-power: Add support for board specific configuration
   mfd: twl4030power: Add a configuration to turn off oscillator during
 off-idle
   ARM: dts: Enable twl4030 off-idle configuration for selected omaps
 
  .../devicetree/bindings/mfd/twl4030-power.txt  |  17 +-
  arch/arm/boot/dts/omap3-beagle-xm.dts  |   6 +
  arch/arm/boot/dts/omap3-evm-common.dtsi|   7 +
  arch/arm/boot/dts/omap3-n900.dts   |   5 +
  drivers/mfd/twl4030-power.c| 269 
 +++--
  include/linux/i2c/twl.h|   4 +
  6 files changed, 284 insertions(+), 24 deletions(-)
 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 3/4] mfd: tps65917: Add driver for the TPS65917 PMIC

2014-05-23 Thread Lee Jones
 The TPS65917 chip is a power management IC for Portable Navigation Systems
 and Tablet Computing devices. It contains the following components:
 
   - Regulators.
   - Over Temperature warning and Shut down.
 
 This patch adds support for tps65917 mfd device. At this time only
 the regulator functionality is made available.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
 v3 Changes:
 
   * Header file formating
   * Changed the cache_type to REGCACHE_RBTREE
   * removed unnecessary code
   * Corrected documentation style
   * Added pm_power_off function
 
   v2 Changes:
 
   * Added volatile register check as some of the registers
 in the set are volatile.
 drivers/mfd/Kconfig  |   12 +
   drivers/mfd/Makefile |1 +
   drivers/mfd/tps65917.c   |  594 +
   include/linux/mfd/tps65917.h | 1485 
  ++
   4 files changed, 2092 insertions(+)
   create mode 100644 drivers/mfd/tps65917.c
   create mode 100644 include/linux/mfd/tps65917.h

[...]

 + ret = regmap_read(tps65917-regmap[slave], addr, reg);
 + if (ret)
 + goto err_irq;
 + }i
 What does the read do?  You're not doing anything with the value.
 This pad1 and pad2 stuff is not needed. I will remove this.
 Then why is it in here?
 
 Did you copy this code from somewhere, if so, where?
 
 Okay, I just answered my own question.  There is so much common code
 in between this and palmas, there is no way I'm going to accept this
 driver.  Please merge it in with the palmas driver!
 
 The chip is more like a subset of palmas with lot of register offset changes
 and register bit field changes. Adding this would make it clumsy.
 There could
 be lot of checks. That is why i chose to write a new driver.
 
 Palmas driver already supports palmas variants and tps659038. Merging
 this would mean more and more checks :-/.

Then find an elegant way of representing the variants.  I'm not
prepared to carry that much duplicated code in MFD.  It's already
overladened and in need of an overhaul.  This will exacerbate the
matter.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 3/4] mfd: tps65917: Add driver for the TPS65917 PMIC

2014-05-23 Thread Lee Jones
 The TPS65917 chip is a power management IC for Portable Navigation 
 Systems
 and Tablet Computing devices. It contains the following components:
 
   - Regulators.
   - Over Temperature warning and Shut down.
 
 This patch adds support for tps65917 mfd device. At this time only
 the regulator functionality is made available.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
 v3 Changes:
 
   * Header file formating
   * Changed the cache_type to REGCACHE_RBTREE
   * removed unnecessary code
   * Corrected documentation style
   * Added pm_power_off function
 
   v2 Changes:
 
   * Added volatile register check as some of the registers
 in the set are volatile.
 drivers/mfd/Kconfig  |   12 +
   drivers/mfd/Makefile |1 +
   drivers/mfd/tps65917.c   |  594 +
   include/linux/mfd/tps65917.h | 1485 
  ++
   4 files changed, 2092 insertions(+)
   create mode 100644 drivers/mfd/tps65917.c
   create mode 100644 include/linux/mfd/tps65917.h
 [...]
 
 +   ret = regmap_read(tps65917-regmap[slave], addr, reg);
 +   if (ret)
 +   goto err_irq;
 +   }i
 What does the read do?  You're not doing anything with the value.
 This pad1 and pad2 stuff is not needed. I will remove this.
 Then why is it in here?
 
 Did you copy this code from somewhere, if so, where?
 
 Okay, I just answered my own question.  There is so much common code
 in between this and palmas, there is no way I'm going to accept this
 driver.  Please merge it in with the palmas driver!
 
 The chip is more like a subset of palmas with lot of register offset changes
 and register bit field changes. Adding this would make it clumsy.
 There could
 be lot of checks. That is why i chose to write a new driver.
 
 Palmas driver already supports palmas variants and tps659038. Merging
 this would mean more and more checks :-/.
 Then find an elegant way of representing the variants.  I'm not
 prepared to carry that much duplicated code in MFD.  It's already
 overladened and in need of an overhaul.  This will exacerbate the
 matter.
 
 
 Okay. I am working on that.

Thanks.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 3/4] mfd: tps65917: Add driver for the TPS65917 PMIC

2014-05-22 Thread Lee Jones
 The TPS65917 chip is a power management IC for Portable Navigation Systems
 and Tablet Computing devices. It contains the following components:
 
   - Regulators.
   - Over Temperature warning and Shut down.
 
 This patch adds support for tps65917 mfd device. At this time only
 the regulator functionality is made available.
 
 Signed-off-by: Keerthy j-keer...@ti.com
 ---
 v3 Changes:
 
   * Header file formating
   * Changed the cache_type to REGCACHE_RBTREE
   * removed unnecessary code
   * Corrected documentation style
   * Added pm_power_off function
 
   v2 Changes:
 
   * Added volatile register check as some of the registers
 in the set are volatile.
 drivers/mfd/Kconfig  |   12 +
   drivers/mfd/Makefile |1 +
   drivers/mfd/tps65917.c   |  594 +
   include/linux/mfd/tps65917.h | 1485 
  ++
   4 files changed, 2092 insertions(+)
   create mode 100644 drivers/mfd/tps65917.c
   create mode 100644 include/linux/mfd/tps65917.h

[...]

 +   for (i = 0; i  TPS65917_NUM_CLIENTS; i++) {
 +   if (i == 0) {
 +   tps65917-i2c_clients[i] = i2c;
 This is messy.  Move this line out of the loop and change the loop
 parameters to start from 1.  Then we can reduce all of this
 unnecessary indentation.
 
 There is a common thing we do after if and else. Removing i == 0
 part out of the
 loop would mean repeating the common part. This way seems
 better.

Ah yes, good point.

 +   } else {
 +   tps65917-i2c_clients[i] =
 +   i2c_new_dummy(i2c-adapter,
 + i2c-addr + i);
 +   if (!tps65917-i2c_clients[i]) {
 +   dev_err(tps65917-dev,
 +   can't attach client %d\n, i);
 +   ret = -ENOMEM;
 +   goto err_i2c;
 +   }
 +
 +   tps65917-i2c_clients[i]-dev.of_node = 
 of_node_get(node);
 Don't forget to decrement the reference when you've finished with it.
 
 I did not get this.

Do you know what of_node_get() does?

[...]

 What happens if !node?  Then no children get registered and this has
 all been a waste of time?
 Only DT way is possible. This check is redundant. I will add a check
 at the beginning for !node.

If that's the case you should add 'depends on OF' in the Kconfig.

 +struct tps65917_reg_init {
 +   /*
 +* 0: reload default values from OTP on warm reset
 +* 1: maintain voltage from VSEL on warm reset
 +*/
 +   bool warm_reset;
 Where is this used?
 
 +   /*
 +* 0: i2c selection of voltage
 +* 1: pin selection of voltage.
 +*/
 +   bool roof_floor;
 And this?
 
 +   /*
 +* For SMPS
 +*
 +* 0: Off
 +* 1: AUTO
 +* 2: ECO
 +* 3: Forced PWM
 +*
 +* For LDO
 +*
 +* 0: Off
 +* 1: On
 +*/
 +   int mode_sleep;
 And this?
 
 +   u8 vsel;
 And this?
 
 All of the above can be used by regulator driver.

Doesn't the regulator driver have its own header file?  Why are these
in a shared file if they're not used anywhere else?

[...]

 +   if (pdata-mux_from_pdata) {
 +   reg = pdata-pad1;
 +   ret = regmap_write(tps65917-regmap[slave], addr, reg);
 +   if (ret)
 +   goto err_irq;
 +   } else {
 +   ret = regmap_read(tps65917-regmap[slave], addr, reg);
 +   if (ret)
 +   goto err_irq;
 +   }
 What does the read do?  You're not doing anything with the value.
 
 This pad1 and pad2 stuff is not needed. I will remove this.

Then why is it in here?

Did you copy this code from somewhere, if so, where? 

Okay, I just answered my own question.  There is so much common code
in between this and palmas, there is no way I'm going to accept this
driver.  Please merge it in with the palmas driver!

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/7] mfd: twl4030-power: Add support for board specific configuration

2014-05-21 Thread Lee Jones
On Tue, 20 May 2014, Tony Lindgren wrote:

 * Lee Jones lee.jo...@linaro.org [140520 08:18]:
  
  Ah, I forgot to Ack this last time, didn't I?
  
Acked-by: Lee Jones lee.jo...@linaro.org
 
 Yeah, here's this one updated with your ack.

Has the code changed at all, or are you just reposting with my Ack
applied?

 8 ---
 From: Tony Lindgren t...@atomide.com
 Date: Tue, 20 May 2014 11:17:54 -0700
 Subject: [PATCH] mfd: twl4030-power: Add support for board specific 
 configuration
 
 With the recommended twl4030 configuration added, we can now add
 board specific changes as modifications to the recommended
 configuration.
 
 Note that the data is private to this driver, and the data must
 always have a NULL resource in the sentinel.
 
 Cc: Peter De Schrijver pdeschrij...@nvidia.com
 Cc: Samuel Ortiz sa...@linux.intel.com
 Acked-by: Lee Jones lee.jo...@linaro.org
 Signed-off-by: Tony Lindgren t...@atomide.com
 
 --- a/drivers/mfd/twl4030-power.c
 +++ b/drivers/mfd/twl4030-power.c
 @@ -567,13 +567,34 @@ twl4030_power_configure_scripts(const struct 
 twl4030_power_data *pdata)
   return 0;
  }
  
 +static void twl4030_patch_rconfig(struct twl4030_resconfig *common,
 +   struct twl4030_resconfig *board)
 +{
 + while (common-resource) {
 + struct twl4030_resconfig *b = board;
 +
 + while (b-resource) {
 + if (b-resource == common-resource) {
 + *common = *b;
 + break;
 + }
 + b++;
 + }
 + common++;
 + }
 +}
 +
  static int
  twl4030_power_configure_resources(const struct twl4030_power_data *pdata)
  {
   struct twl4030_resconfig *resconfig = pdata-resource_config;
 + struct twl4030_resconfig *boardconf = pdata-board_config;
   int err;
  
   if (resconfig) {
 + if (boardconf)
 + twl4030_patch_rconfig(resconfig, boardconf);
 +
   while (resconfig-resource) {
   err = twl4030_configure_resource(resconfig);
   if (err)
 --- a/include/linux/i2c/twl.h
 +++ b/include/linux/i2c/twl.h
 @@ -674,6 +674,7 @@ struct twl4030_power_data {
   struct twl4030_script **scripts;
   unsigned num;
   struct twl4030_resconfig *resource_config;
 + struct twl4030_resconfig *board_config;
  #define TWL4030_RESCONFIG_UNDEF  ((u8)-1)
   bool use_poweroff;  /* Board is wired for TWL poweroff */
  };

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/7] mfd: twl4030-power: Enable off-idle configuration when booted with device tree

2014-05-21 Thread Lee Jones
 Here's an updated set of patches to enable low-power idle modes
 for some omap3 boards when booted with device tree.
 
 This series when applied on top of the patches in tread   
   
   
 [PATCH 00/11] Fixes for omap PM for making omap3 DT only,
 or omap-for-v3.16/pm branch.
 
 Lee, if these patches look OK to you, please feel free to 
 pick them, preferrably to the immutable branch you already
 have set up so I can also merge them in to be able to have
 things working in my branch properly for PM.

Okay, it looks like this series is good to go now.  If you believe so
too, give me the nod and I'll apply.

 Tony Lindgren (7):
   mfd: twl4030-power: Fix hang on reboot if sleep configuration was
 loaded earlier
   mfd: twl4030-power: Fix some defines for SW_EVENTS
   mfd: twl4030-power: Add generic reset configuration
   mfd: twl4030-power: Add recommended idle configuration
   mfd: twl4030-power: Add support for board specific configuration
   mfd: twl4030power: Add a configuration to turn off oscillator during
 off-idle
   ARM: dts: Enable twl4030 off-idle configuration for selected omaps
 
  .../devicetree/bindings/mfd/twl4030-power.txt  |  17 +-
  arch/arm/boot/dts/omap3-beagle-xm.dts  |   6 +
  arch/arm/boot/dts/omap3-evm-common.dtsi|   7 +
  arch/arm/boot/dts/omap3-n900.dts   |   5 +
  drivers/mfd/twl4030-power.c| 269 
 +++--
  include/linux/i2c/twl.h|   4 +
  6 files changed, 284 insertions(+), 24 deletions(-)
 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/7] mfd: twl4030-power: Add support for board specific configuration

2014-05-21 Thread Lee Jones
   * Lee Jones lee.jo...@linaro.org [140520 08:18]:

Ah, I forgot to Ack this last time, didn't I?

  Acked-by: Lee Jones lee.jo...@linaro.org
   
   Yeah, here's this one updated with your ack.
  
  Has the code changed at all, or are you just reposting with my Ack
  applied?
 
 No changes, I just reposted this with your ack as you
 seemed to prefer for some of the other patches :)

Only for whole series re-submissions.  I'm not that lazy. :)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 3/4] mfd: tps65917: Add driver for the TPS65917 PMIC

2014-05-20 Thread Lee Jones
  0x0c
 +#define TPS65917_SMPS1_CTRL_MODE_SLEEP_SHIFT 2
 +#define TPS65917_SMPS1_CTRL_MODE_ACTIVE_MASK 0x03
 +#define TPS65917_SMPS1_CTRL_MODE_ACTIVE_SHIFT0

Pick a base and stick with it.  I suggest hex throughout.

[...]

 +/* Bit definitions for SMPS_PLL_CTRL */
 +
 +#define TPS65917_SMPS_PLL_CTRL_PLL_EN_PLL_BYPASS_SHIFT   0x8
 +#define TPS65917_SMPS_PLL_CTRL_PLL_PLL_EN_BYPASS 3
 +#define TPS65917_SMPS_PLL_CTRL_PLL_PLL_BYPASS_CLK_SHIFT  0x4
 +#define TPS65917_SMPS_PLL_CTRL_PLL_PLL_BYPASS_CLK2
 +
 +

Remove this line.

 +/* Registers for function LDO */
 +#define TPS65917_LDO1_CTRL   0x0
 +#define TPS65917_LDO1_VOLTAGE0x1
 +#define TPS65917_LDO2_CTRL   0x2
 +#define TPS65917_LDO2_VOLTAGE0x3
 +#define TPS65917_LDO3_CTRL   0x4
 +#define TPS65917_LDO3_VOLTAGE0x5
 +#define TPS65917_LDO4_CTRL   0xE
 +#define TPS65917_LDO4_VOLTAGE0xF

Also standardise the number of digits represented and either
capitalise none or all of the hex letters.

[...]

 +static inline int tps65917_read(struct tps65917 *tps65917, unsigned int base,
 + unsigned int reg, unsigned int *val)
 +{
 + unsigned int addr =  TPS65917_BASE_TO_REG(base, reg);

Extra ' '.

 + int slave_id = TPS65917_BASE_TO_SLAVE(base);
 +
 + return regmap_read(tps65917-regmap[slave_id], addr, val);
 +}
 +
 +static inline int tps65917_write(struct tps65917 *tps65917, unsigned int 
 base,
 +  unsigned int reg, unsigned int value)
 +{
 + unsigned int addr = TPS65917_BASE_TO_REG(base, reg);
 + int slave_id = TPS65917_BASE_TO_SLAVE(base);
 +
 + return regmap_write(tps65917-regmap[slave_id], addr, value);
 +}
 +
 +static inline int tps65917_bulk_write(struct tps65917 *tps65917,
 +   unsigned int base,
 +   unsigned int reg, const void *val,
 +   size_t val_count)
 +{
 + unsigned int addr = TPS65917_BASE_TO_REG(base, reg);
 + int slave_id = TPS65917_BASE_TO_SLAVE(base);
 +
 + return regmap_bulk_write(tps65917-regmap[slave_id], addr,
 +  val, val_count);
 +}
 +
 +static inline int tps65917_bulk_read(struct tps65917 *tps65917,
 +  unsigned int base,
 +  unsigned int reg, void *val,
 +  size_t val_count)
 +{
 + unsigned int addr = TPS65917_BASE_TO_REG(base, reg);
 + int slave_id = TPS65917_BASE_TO_SLAVE(base);
 +
 + return regmap_bulk_read(tps65917-regmap[slave_id], addr,
 + val, val_count);
 +}
 +
 +static inline int tps65917_update_bits(struct tps65917 *tps65917,
 +unsigned int base, unsigned int reg,
 +unsigned int mask, unsigned int val)
 +{
 + unsigned int addr = TPS65917_BASE_TO_REG(base, reg);
 + int slave_id = TPS65917_BASE_TO_SLAVE(base);
 +
 + return regmap_update_bits(tps65917-regmap[slave_id], addr, mask, val);
 +}
 +
 +static inline int tps65917_irq_get_virq(struct tps65917 *tps65917, int irq)
 +{
 + return regmap_irq_get_virq(tps65917-irq_data, irq);
 +}

This is quite a lot of overhead.  Are you sure you require them?

 +int tps65917_ext_control_req_config(struct tps65917 *tps65917,
 + enum tps65917_external_requestor_id 
 ext_control_req_id,
 + int ext_ctrl, bool enable);
 +
 +#endif /*  __LINUX_MFD_TPS65917_H */

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] mfd: twl4030-power: Fix hang on reboot if sleep configuration was loaded earlier

2014-05-20 Thread Lee Jones
On Tue, 13 May 2014, Tony Lindgren wrote:

 Looks like we can still hit the issue of wrong load order of
 twl4030 configuration. If we have a sleep configuration loaded,
 and do a warm reset, the device can hang while initializing the
 wakeup12 sequence. We do have a warning message about wrong order
 of twl4030 configuration, but in this case it does not help as
 the sleep configuration was loaded during the previous boot and
 the state of twl4030 is maintained throughout the warm reset.
 
 Fix the issue by clearing any existing sleep configuration
 before we load the warm reset configuration.
 
 Cc: Peter Ujfalusi peter.ujfal...@ti.com
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
  drivers/mfd/twl4030-power.c | 6 ++
  1 file changed, 6 insertions(+)

Can't vouch for the semantics of the patch, but the code looks good.

  Acked-by: Lee Jones lee.jo...@linaro.org

Can I just apply this, or would you like Peter to review it first?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/7] mfd: twl4030-power: Fix some defines for SW_EVENTS

2014-05-20 Thread Lee Jones
 We have these bits partially defined in two different
 places, so let's fix them up and add defines for the
 missing bits. These bits are the same for P1_SW_EVENTS,
 P2_SW_EVENTS and P3_SW_EVENTS.
 
 Cc: Peter Ujfalusi peter.ujfal...@ti.com
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
  drivers/mfd/twl4030-power.c | 23 +--
  1 file changed, 13 insertions(+), 10 deletions(-)
 
 diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
 index 1b30d8a..c0e4fc3 100644
 --- a/drivers/mfd/twl4030-power.c
 +++ b/drivers/mfd/twl4030-power.c
 @@ -35,7 +35,14 @@
  static u8 twl4030_start_script_address = 0x2b;
  
  #define PWR_P1_SW_EVENTS 0x10

BIT(4)?

 +#define PWR_STOPON_PRWON (1  6)
 +#define PWR_STOPON_SYSEN (1  5)
 +#define PWR_ENABLE_WARMRESET (1  4)
 +#define PWR_LVL_WAKEUP   (1  3)
 +#define PWR_DEVACT   (1  2)
 +#define PWR_DEVSLP   (1  1)
  #define PWR_DEVOFF   (1  0)
 +
  #define SEQ_OFFSYNC  (1  0)

Please use the BIT() macro for these.

[...]

Once fixed, apply my Acked-by on re-submission.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/7] mfd: twl4030-power: Add generic reset configuration

2014-05-20 Thread Lee Jones

 The twl4030 PMIC needs to be configured properly for things like
 warm reset and deeper idle states so the PMIC manages the regulators
 properly based on the hardware triggers from the SoC.
 
 For example, when rebooting an OMAP3530 at 125 MHz, it hangs.
 With this patch, TWL4030 will be reset when a warm reset occures.
 This way the OMAP3530 does not hang on reboot.
 
 Let's use this as the default when compatible = ti,twl4030-power.
 Other more complicated configurations can be added to the driver
 based on other compatible flags.
 
 Based on earlier patch by Matthias Brugger matthias@gmail.com:
 
 http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/144165.html
 
 And Lesly A M lesl...@ti.com:
 
 https://github.com/openembedded/openembedded/blob/master/recipes/linux/linux-omap-2.6.39/mfd/0010-MFD-TWL4030-power-scripts-for-OMAP3-boards.patch
 
 For more information about twl4030 configuration for the
 power scripts see:
 
 http://www.omappedia.com/wiki/TWL4030_power_scripts

Do you really want this bumph in the commit log?

 Cc: Matthias Brugger matthias@gmail.com
 Cc: Robert Nelson robertcnel...@gmail.com
 Cc: Peter De Schrijver pdeschrij...@nvidia.com
 Cc: Samuel Ortiz sa...@linux.intel.com
 Cc: Lee Jones lee.jo...@linaro.org
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
  .../devicetree/bindings/mfd/twl4030-power.txt  |  7 +-
  drivers/mfd/twl4030-power.c| 99 
 +++---
  include/linux/i2c/twl.h|  3 +
  3 files changed, 95 insertions(+), 14 deletions(-)
 
 diff --git a/Documentation/devicetree/bindings/mfd/twl4030-power.txt 
 b/Documentation/devicetree/bindings/mfd/twl4030-power.txt
 index 8e15ec3..b906116 100644
 --- a/Documentation/devicetree/bindings/mfd/twl4030-power.txt
 +++ b/Documentation/devicetree/bindings/mfd/twl4030-power.txt
 @@ -5,7 +5,12 @@ to control the power resources, including power scripts. For 
 now, the
  binding only supports the complete shutdown of the system after poweroff.
  
  Required properties:
 -- compatible : must be ti,twl4030-power
 +- compatible : must be one of the following
 + ti,twl4030-power
 + ti,twl4030-power-reset
 +
 +The use of ti,twl4030-power-reset is recommended at least on
 +3530 that needs a special configuration for warm reset to work.
  
  Optional properties:
  - ti,use_poweroff: With this flag, the chip will initiates an ACTIVE-to-OFF 
 or
 diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
 index c0e4fc3..b61b725 100644
 --- a/drivers/mfd/twl4030-power.c
 +++ b/drivers/mfd/twl4030-power.c
 @@ -29,6 +29,7 @@
  #include linux/i2c/twl.h
  #include linux/platform_device.h
  #include linux/of.h
 +#include linux/of_device.h
  
  #include asm/mach-types.h
  
 @@ -128,6 +129,30 @@ static u8 res_config_addrs[] = {
   [RES_MAIN_REF]  = 0x94,
  };
  
 +/*
 + * Usable values for .remap_sleep and .remap_off
 + * Based on table 5.3.3 Resource Operating modes
 + */
 +enum {
 + TWL_REMAP_OFF = 0,
 + TWL_REMAP_SLEEP = 8,
 + TWL_REMAP_ACTIVE = 9,
 +};
 +
 +#define TWL_RESOURCE_ON(res) \
 + { MSG_SINGULAR(DEV_GRP_NULL, (res), RES_STATE_ACTIVE), 0x02 }

Was ist das? Magic, floating, fluffy numbers.

 +#define TWL_RESOURCE_OFF(res)
 \
 + { MSG_SINGULAR(DEV_GRP_NULL, (res), RES_STATE_OFF), 0x02 }
 +#define TWL_RESOURCE_RESET(res)  
 \
 + { MSG_SINGULAR(DEV_GRP_NULL, (res), RES_STATE_WRST), 0x02 }
 +#define TWL_RESOURCE_GROUP_RESET(group, type1, type2)
 \
 + { MSG_BROADCAST(DEV_GRP_NULL, (group), (type1), (type2),\
 + RES_STATE_WRST), 0x02 }
 +#define TWL_REMAP_SLEEP(res, devgrp, typ, typ2)  
 \
 + { .resource = (res), .devgroup = (devgrp),  \
 +   .type = (typ), .type2 = (typ2),   \
 +   .remap_off = TWL_REMAP_OFF, .remap_sleep = TWL_REMAP_SLEEP, }
 +
  static int twl4030_write_script_byte(u8 address, u8 byte)
  {
   int err;
 @@ -502,7 +527,8 @@ int twl4030_remove_script(u8 flags)
   return err;
  }
  
 -static int twl4030_power_configure_scripts(struct twl4030_power_data *pdata)
 +static int
 +twl4030_power_configure_scripts(const struct twl4030_power_data *pdata)

Is this doing anything besides some sneaky clean-up?  If not, it
might be worth mentioning that you're taking advantage of these
changes to conduct such activities.

  {
   int err;
   int i;
 @@ -518,7 +544,8 @@ static int twl4030_power_configure_scripts(struct 
 twl4030_power_data *pdata)
   return 0;
  }
  
 -static int twl4030_power_configure_resources(struct twl4030_power_data 
 *pdata)
 +static int
 +twl4030_power_configure_resources(const struct twl4030_power_data *pdata)

Ditto.

  {
   struct twl4030_resconfig *resconfig = pdata-resource_config;
   int

Re: [PATCH 4/7] mfd: twl4030-power: Add recommended idle configuration

2014-05-20 Thread Lee Jones
 These settings are based on the Recommended Sleep Sequences for
 the Zoom Platform pdf at:
 
 http://omappedia.com/wiki/File:Recommended_Sleep_Sequences_Zoom.pdf
 
 These settings assume most of the regulators are under control of
 Linux, and twl4030 only cuts off VDD1 and VDD2 during off-idle as
 Linux cannot do it.
 
 For any board specific changes to these, let's patch them in as
 changes to the generic data in the follow-up patches. This keeps
 the board specific changes small.
 
 Note that this does not consider the twl5030 errata 27 and 28.
 That can be added later on after it has been tested. For more
 information about errata 27 and 28, please see:
 
 https://github.com/openembedded/openembedded/blob/master/recipes/linux/linux-omap-2.6.39/mfd/0012-MFD-TWL4030-workaround-changes-for-Erratum-27.patch
 
 Cc: Peter De Schrijver pdeschrij...@nvidia.com
 Cc: Samuel Ortiz sa...@linux.intel.com
 Acked-by: Lee Jones lee.jo...@linaro.org
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
  .../devicetree/bindings/mfd/twl4030-power.txt  |   4 +
  drivers/mfd/twl4030-power.c| 103 
 +
  2 files changed, 107 insertions(+)

Assuming the magic numbers are replaced by transparent #defines:

  Acked-by: Lee Jones lee.jo...@linaro.org

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   3   >