Re: [PATCHv4 2/4] regulator: omap smps regulator driver

2011-08-23 Thread Liam Girdwood
On 22/08/11 23:39, Hilman, Kevin wrote:
 Liam Girdwood l...@ti.com writes:
 
 On 05/08/11 20:33, Hilman, Kevin wrote:
 Mark Brown broo...@opensource.wolfsonmicro.com writes:

 On Thu, Jul 28, 2011 at 02:48:57PM +0300, Tero Kristo wrote:
 OMAP SMPS regulator driver provides access to OMAP voltage processor
 controlled regulators. These include VDD_MPU and VDD_CORE for OMAP3 and
 additionally VDD_IVA for OMAP4. SMPS regulators use the OMAP voltage
 layer for the actual voltage regulation operations.

 Signed-off-by: Tero Kristo t-kri...@ti.com

 Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com

 Do you prefer we merge this via OMAP trees (along with the
 infrastructure) or would you like to merge it.

 At this point, it's probably best to merge it along with the voltage
 infrastructure, which still might change slightly at the API level.


 Ok, lets merge with the voltage infrastructure.

 
 OK, shall I take this is an Ack from you then?
 
 Kevin

Sorry, yes.

Acked-by: Liam Girdwood l...@ti.com
--
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: [PATCHv4 2/4] regulator: omap smps regulator driver

2011-08-22 Thread Kevin Hilman
Liam Girdwood l...@ti.com writes:

 On 05/08/11 20:33, Hilman, Kevin wrote:
 Mark Brown broo...@opensource.wolfsonmicro.com writes:
 
 On Thu, Jul 28, 2011 at 02:48:57PM +0300, Tero Kristo wrote:
 OMAP SMPS regulator driver provides access to OMAP voltage processor
 controlled regulators. These include VDD_MPU and VDD_CORE for OMAP3 and
 additionally VDD_IVA for OMAP4. SMPS regulators use the OMAP voltage
 layer for the actual voltage regulation operations.

 Signed-off-by: Tero Kristo t-kri...@ti.com

 Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com
 
 Do you prefer we merge this via OMAP trees (along with the
 infrastructure) or would you like to merge it.
 
 At this point, it's probably best to merge it along with the voltage
 infrastructure, which still might change slightly at the API level.
 

 Ok, lets merge with the voltage infrastructure.


OK, shall I take this is an Ack from you then?

Kevin
--
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: [PATCHv4 2/4] regulator: omap smps regulator driver

2011-08-08 Thread Liam Girdwood
On 05/08/11 20:33, Hilman, Kevin wrote:
 Mark Brown broo...@opensource.wolfsonmicro.com writes:
 
 On Thu, Jul 28, 2011 at 02:48:57PM +0300, Tero Kristo wrote:
 OMAP SMPS regulator driver provides access to OMAP voltage processor
 controlled regulators. These include VDD_MPU and VDD_CORE for OMAP3 and
 additionally VDD_IVA for OMAP4. SMPS regulators use the OMAP voltage
 layer for the actual voltage regulation operations.

 Signed-off-by: Tero Kristo t-kri...@ti.com

 Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com
 
 Do you prefer we merge this via OMAP trees (along with the
 infrastructure) or would you like to merge it.
 
 At this point, it's probably best to merge it along with the voltage
 infrastructure, which still might change slightly at the API level.
 

Ok, lets merge with the voltage infrastructure.

Thanks

Liam
--
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: [PATCHv4 2/4] regulator: omap smps regulator driver

2011-08-05 Thread Kevin Hilman
Mark Brown broo...@opensource.wolfsonmicro.com writes:

 On Thu, Jul 28, 2011 at 02:48:57PM +0300, Tero Kristo wrote:
 OMAP SMPS regulator driver provides access to OMAP voltage processor
 controlled regulators. These include VDD_MPU and VDD_CORE for OMAP3 and
 additionally VDD_IVA for OMAP4. SMPS regulators use the OMAP voltage
 layer for the actual voltage regulation operations.
 
 Signed-off-by: Tero Kristo t-kri...@ti.com

 Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com

Do you prefer we merge this via OMAP trees (along with the
infrastructure) or would you like to merge it.

At this point, it's probably best to merge it along with the voltage
infrastructure, which still might change slightly at the API level.

Kevin
--
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: [PATCHv4 2/4] regulator: omap smps regulator driver

2011-08-05 Thread Kevin Hilman
Tero Kristo t-kri...@ti.com writes:

 OMAP SMPS regulator driver provides access to OMAP voltage processor
 controlled regulators. These include VDD_MPU and VDD_CORE for OMAP3 and
 additionally VDD_IVA for OMAP4. SMPS regulators use the OMAP voltage
 layer for the actual voltage regulation operations.

 Signed-off-by: Tero Kristo t-kri...@ti.com

FYI, this adds a section mismatch warning:

WARNING: vmlinux.o(.devinit.text+0x1984): Section mismatch in reference from 
the function omap_smps_reg_probe() to the (unknown reference) 
.init.data:(unknown)
The function __devinit omap_smps_reg_probe() references
a (unknown reference) __initdata (unknown).
If (unknown) is only used by omap_smps_reg_probe then
annotate (unknown) with a matching annotation.

--
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: [PATCHv4 2/4] regulator: omap smps regulator driver

2011-07-29 Thread Mark Brown
On Thu, Jul 28, 2011 at 02:48:57PM +0300, Tero Kristo wrote:
 OMAP SMPS regulator driver provides access to OMAP voltage processor
 controlled regulators. These include VDD_MPU and VDD_CORE for OMAP3 and
 additionally VDD_IVA for OMAP4. SMPS regulators use the OMAP voltage
 layer for the actual voltage regulation operations.
 
 Signed-off-by: Tero Kristo t-kri...@ti.com

Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com
--
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


[PATCHv4 2/4] regulator: omap smps regulator driver

2011-07-28 Thread Tero Kristo
OMAP SMPS regulator driver provides access to OMAP voltage processor
controlled regulators. These include VDD_MPU and VDD_CORE for OMAP3 and
additionally VDD_IVA for OMAP4. SMPS regulators use the OMAP voltage
layer for the actual voltage regulation operations.

Signed-off-by: Tero Kristo t-kri...@ti.com
Cc: Kevin Hilman khil...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Todd Poynor toddpoy...@google.com
Cc: Mark Brown broo...@opensource.wolfsonmicro.com
Cc: Liam Girdwood l...@ti.com
Cc: Graeme Gregory g...@slimlogic.co.uk
---
 drivers/regulator/Kconfig   |8 ++
 drivers/regulator/Makefile  |1 +
 drivers/regulator/omap-smps-regulator.c |  182 +++
 include/linux/regulator/omap-smps.h |   20 
 4 files changed, 211 insertions(+), 0 deletions(-)
 create mode 100644 drivers/regulator/omap-smps-regulator.c
 create mode 100644 include/linux/regulator/omap-smps.h

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index d7ed20f..2ba8ed2 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -303,5 +303,13 @@ config REGULATOR_TPS65910
help
  This driver supports TPS65910 voltage regulator chips.
 
+config REGULATOR_OMAP_SMPS
+   tristate TI OMAP SMPS Power Regulators
+   depends on (ARCH_OMAP3 || ARCH_OMAP4)  PM
+   help
+ This driver supports the OMAP3 / OMAP4 SMPS regulators for VDD1,
+ VDD2 and VDD3. These regulators are accessed using the voltage
+ processor interface of OMAP.
+
 endif
 
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 3932d2e..191e3d5 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -43,5 +43,6 @@ obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o
 obj-$(CONFIG_REGULATOR_AB8500) += ab8500.o
 obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o
 obj-$(CONFIG_REGULATOR_TPS65910) += tps65910-regulator.o
+obj-$(CONFIG_REGULATOR_OMAP_SMPS) += omap-smps-regulator.o
 
 ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
diff --git a/drivers/regulator/omap-smps-regulator.c 
b/drivers/regulator/omap-smps-regulator.c
new file mode 100644
index 000..e4a0262
--- /dev/null
+++ b/drivers/regulator/omap-smps-regulator.c
@@ -0,0 +1,181 @@
+/*
+ * OMAP SMPS regulator driver
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc.
+ *
+ * Author: Tero Kristo t-kri...@ti.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include linux/kernel.h
+#include linux/ctype.h
+#include linux/module.h
+#include linux/slab.h
+#include linux/init.h
+#include linux/err.h
+#include linux/delay.h
+#include linux/platform_device.h
+#include linux/regulator/driver.h
+#include linux/regulator/machine.h
+#include linux/regulator/omap-smps.h
+#include plat/voltage.h
+
+#define DRIVER_NAMEomap-smps
+
+struct omap_smps_reg_info {
+   const char  *vdd_name;
+   struct regulator_dev*rdev;
+   struct voltagedomain*voltdm;
+   struct regulator_desc   desc;
+};
+
+static int omap_smps_set_voltage(struct regulator_dev *rdev, int min_uV,
+   int max_uV, unsigned *selector)
+{
+   struct omap_smps_reg_info   *info = rdev_get_drvdata(rdev);
+   return voltdm_scale(info-voltdm, min_uV);
+}
+
+static int omap_smps_get_voltage(struct regulator_dev *rdev)
+{
+   struct omap_smps_reg_info   *info = rdev_get_drvdata(rdev);
+   return voltdm_get_voltage(info-voltdm);
+}
+
+static struct regulator_ops omap_smps_ops = {
+   .set_voltage= omap_smps_set_voltage,
+   .get_voltage= omap_smps_get_voltage,
+};
+
+#define SMPS_REG(name) { \
+   .vdd_name = #name, \
+   .desc = { \
+   .ops = omap_smps_ops, \
+   .type = REGULATOR_VOLTAGE, \
+   .owner = THIS_MODULE, \
+   }, \
+   }
+
+static struct omap_smps_reg_info omap_smps_regs[] = {
+   SMPS_REG(mpu),
+   SMPS_REG(mpu_iva),
+   SMPS_REG(iva),
+   SMPS_REG(core),
+};
+
+static void omap_smps_reg_cleanup(void)
+{
+   int i;
+   struct omap_smps_reg_info   *info;
+
+   for (i = 0; i  ARRAY_SIZE(omap_smps_regs); i++) {
+   info = omap_smps_regs[i];
+   if (info-rdev) {
+   regulator_unregister(info-rdev);
+   info-rdev = NULL;
+   }
+
+   kfree(info-desc.name);
+   info-desc.name = NULL;
+   }
+}
+
+static struct regulator_init_data dummy_initdata __initdata;
+
+static int __devinit omap_smps_reg_probe(struct platform_device *pdev)
+{
+   int i, j, ret;
+   struct omap_smps_reg_info   *info;
+   struct