RE: [PATCH v1 resend] regulator: new driver for LP8755

2012-12-05 Thread Jeong, Daniel

>From: Mark Brown [mailto:broo...@opensource.wolfsonmicro.com] 
>Sent: Thursday, December 06, 2012 2:34 PM
>To: Daniel Jeong
>Cc: Girdwood, Liam; Jeong, Daniel; linux-kernel@vger.kernel.org
>Subject: Re: [PATCH v1 resend] regulator: new driver for LP8755

>On Thu, Dec 06, 2012 at 02:07:43PM +0900, Daniel Jeong wrote:
>> This driver is a general version for lp8755 regulator driver of TI.
>> 
>> LP8755 :
>> The LP8755 is a high performance power management unit.It contains six 
>> step-down DC-DC converters which can can be filexibly bundled together 
>> in multiphase converters as required by application.
>> www.ti.com

>You've resent this after about 24 hours, please allow sane times for a 
>response.

Sorry. I mis-typed the email address so we couldn't find it at lkml. 

So I sent it again but it's same patch file(source doesn't changed).

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v1 resend] regulator: new driver for LP8755

2012-12-05 Thread Mark Brown
On Thu, Dec 06, 2012 at 02:07:43PM +0900, Daniel Jeong wrote:
> This driver is a general version for lp8755 regulator driver of TI.
> 
> LP8755 :
> The LP8755 is a high performance power management unit.It contains
> six step-down DC-DC converters which can can be filexibly bundled
> together in multiphase converters as required by application.
> www.ti.com

You've resent this after about 24 hours, please allow sane times for a
response.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v1 resend] regulator: new driver for LP8755

2012-12-05 Thread Daniel Jeong
This driver is a general version for lp8755 regulator driver of TI.

LP8755 :
The LP8755 is a high performance power management unit.It contains
six step-down DC-DC converters which can can be filexibly bundled
together in multiphase converters as required by application.
www.ti.com

Signed-off-by: Daniel Jeong 
---
 drivers/regulator/Kconfig|9 +
 drivers/regulator/Makefile   |1 +
 drivers/regulator/lp8755.c   |  586 ++
 include/linux/platform_data/lp8755.h |   71 
 4 files changed, 667 insertions(+), 0 deletions(-)
 create mode 100644 drivers/regulator/lp8755.c
 create mode 100644 include/linux/platform_data/lp8755.h

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 67d47b59..63e37ff 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -257,6 +257,15 @@ config REGULATOR_LP872X
help
  This driver supports LP8720/LP8725 PMIC
 
+config REGULATOR_LP8755
+   tristate "TI LP8755 Hihg Performance PMU driver"
+   depends on I2C
+   select REGMAP_I2C
+   help
+ This driver supports LP8755 High Performance PMU driver. This
+ chip contains six step-down DC/DC converters which can support
+ 9 mode multiphase configuration.
+
 config REGULATOR_LP8788
bool "TI LP8788 Power Regulators"
depends on MFD_LP8788
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index e431eed..bf346b7 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
 obj-$(CONFIG_REGULATOR_LP872X) += lp872x.o
 obj-$(CONFIG_REGULATOR_LP8788) += lp8788-buck.o
 obj-$(CONFIG_REGULATOR_LP8788) += lp8788-ldo.o
+obj-$(CONFIG_REGULATOR_LP8755) += lp8755.o
 obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
 obj-$(CONFIG_REGULATOR_MAX8649)+= max8649.o
 obj-$(CONFIG_REGULATOR_MAX8660) += max8660.o
diff --git a/drivers/regulator/lp8755.c b/drivers/regulator/lp8755.c
new file mode 100644
index 000..0dfb2a8
--- /dev/null
+++ b/drivers/regulator/lp8755.c
@@ -0,0 +1,586 @@
+/*
+ * LP8755 High Performance Power Management Unit : System Interface Driver
+ * (based on rev. 0.26)
+ * Copyright 2012 Texas Instruments
+ *
+ * Author: Daniel(Geon Si) Jeong 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define LP8755_REG_BUCK0   0x00
+#define LP8755_REG_BUCK1   0x03
+#define LP8755_REG_BUCK2   0x04
+#define LP8755_REG_BUCK3   0x01
+#define LP8755_REG_BUCK4   0x05
+#define LP8755_REG_BUCK5   0x02
+#define LP8755_REG_MAX 0xFF
+
+#define LP8755_BUCK_EN_M   BIT(7)
+#define LP8755_BUCK_LINEAR_OUT_MAX 0x76
+#define LP8755_BUCK_VOUT_M 0x7F
+
+enum bucks {
+   BUCK0 = 0,
+   BUCK1,
+   BUCK2,
+   BUCK3,
+   BUCK4,
+   BUCK5,
+};
+
+struct lp8755_mphase {
+   int nreg;
+   int buck_num[LP8755_BUCK_MAX];
+};
+
+struct lp8755_chip {
+   struct device *dev;
+   struct regmap *regmap;
+   struct lp8755_platform_data *pdata;
+
+   int irq;
+   unsigned int irqmask;
+
+   int num_reg;
+   int mphase;
+   struct regulator_dev *rdev[LP8755_BUCK_MAX];
+};
+
+/**
+ *lp8755_read : read a single register value from lp8755.
+ */
+static int lp8755_read(struct lp8755_chip *pchip, unsigned int reg,
+  unsigned int *val)
+{
+   return regmap_read(pchip->regmap, reg, val);
+}
+
+/**
+ *lp8755_write : write a single register value to lp8755.
+ */
+static int lp8755_write(struct lp8755_chip *pchip, unsigned int reg,
+   unsigned int val)
+{
+   return regmap_write(pchip->regmap, reg, val);
+}
+
+/**
+ *lp8755_update_bits : set the values of bit fields in lp8755 register.
+ */
+static int lp8755_update_bits(struct lp8755_chip *pchip, unsigned int reg,
+ unsigned int mask, unsigned int val)
+{
+   return regmap_update_bits(pchip->regmap, reg, mask, val);
+}
+
+static int lp8755_buck_enable_time(struct regulator_dev *rdev)
+{
+   int ret;
+   unsigned int regval;
+   enum lp8755_bucks id = rdev_get_id(rdev);
+   struct lp8755_chip *pchip = rdev_get_drvdata(rdev);
+
+   ret = lp8755_read(pchip, 0x12 + id, );
+   if (ret < 0) {
+   dev_err(pchip->dev, "i2c acceess error %s\n", __func__);
+   return ret;
+   }
+   return (regval & 0xff) * 100;
+}
+
+static int lp8755_buck_set_mode(struct regulator_dev *rdev, unsigned int mode)
+{
+   int ret;
+   unsigned int regbval = 0x0;
+   enum lp8755_bucks id = rdev_get_id(rdev);
+   struct lp8755_chip *pchip = 

[PATCH v1 resend] regulator: new driver for LP8755

2012-12-05 Thread Daniel Jeong
This driver is a general version for lp8755 regulator driver of TI.

LP8755 :
The LP8755 is a high performance power management unit.It contains
six step-down DC-DC converters which can can be filexibly bundled
together in multiphase converters as required by application.
www.ti.com

Signed-off-by: Daniel Jeong gshark.je...@gmail.com
---
 drivers/regulator/Kconfig|9 +
 drivers/regulator/Makefile   |1 +
 drivers/regulator/lp8755.c   |  586 ++
 include/linux/platform_data/lp8755.h |   71 
 4 files changed, 667 insertions(+), 0 deletions(-)
 create mode 100644 drivers/regulator/lp8755.c
 create mode 100644 include/linux/platform_data/lp8755.h

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 67d47b59..63e37ff 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -257,6 +257,15 @@ config REGULATOR_LP872X
help
  This driver supports LP8720/LP8725 PMIC
 
+config REGULATOR_LP8755
+   tristate TI LP8755 Hihg Performance PMU driver
+   depends on I2C
+   select REGMAP_I2C
+   help
+ This driver supports LP8755 High Performance PMU driver. This
+ chip contains six step-down DC/DC converters which can support
+ 9 mode multiphase configuration.
+
 config REGULATOR_LP8788
bool TI LP8788 Power Regulators
depends on MFD_LP8788
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index e431eed..bf346b7 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
 obj-$(CONFIG_REGULATOR_LP872X) += lp872x.o
 obj-$(CONFIG_REGULATOR_LP8788) += lp8788-buck.o
 obj-$(CONFIG_REGULATOR_LP8788) += lp8788-ldo.o
+obj-$(CONFIG_REGULATOR_LP8755) += lp8755.o
 obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
 obj-$(CONFIG_REGULATOR_MAX8649)+= max8649.o
 obj-$(CONFIG_REGULATOR_MAX8660) += max8660.o
diff --git a/drivers/regulator/lp8755.c b/drivers/regulator/lp8755.c
new file mode 100644
index 000..0dfb2a8
--- /dev/null
+++ b/drivers/regulator/lp8755.c
@@ -0,0 +1,586 @@
+/*
+ * LP8755 High Performance Power Management Unit : System Interface Driver
+ * (based on rev. 0.26)
+ * Copyright 2012 Texas Instruments
+ *
+ * Author: Daniel(Geon Si) Jeong daniel.je...@ti.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include linux/module.h
+#include linux/slab.h
+#include linux/i2c.h
+#include linux/err.h
+#include linux/irq.h
+#include linux/interrupt.h
+#include linux/gpio.h
+#include linux/regmap.h
+#include linux/delay.h
+#include linux/uaccess.h
+#include linux/regulator/driver.h
+#include linux/regulator/machine.h
+#include linux/platform_data/lp8755.h
+
+#define LP8755_REG_BUCK0   0x00
+#define LP8755_REG_BUCK1   0x03
+#define LP8755_REG_BUCK2   0x04
+#define LP8755_REG_BUCK3   0x01
+#define LP8755_REG_BUCK4   0x05
+#define LP8755_REG_BUCK5   0x02
+#define LP8755_REG_MAX 0xFF
+
+#define LP8755_BUCK_EN_M   BIT(7)
+#define LP8755_BUCK_LINEAR_OUT_MAX 0x76
+#define LP8755_BUCK_VOUT_M 0x7F
+
+enum bucks {
+   BUCK0 = 0,
+   BUCK1,
+   BUCK2,
+   BUCK3,
+   BUCK4,
+   BUCK5,
+};
+
+struct lp8755_mphase {
+   int nreg;
+   int buck_num[LP8755_BUCK_MAX];
+};
+
+struct lp8755_chip {
+   struct device *dev;
+   struct regmap *regmap;
+   struct lp8755_platform_data *pdata;
+
+   int irq;
+   unsigned int irqmask;
+
+   int num_reg;
+   int mphase;
+   struct regulator_dev *rdev[LP8755_BUCK_MAX];
+};
+
+/**
+ *lp8755_read : read a single register value from lp8755.
+ */
+static int lp8755_read(struct lp8755_chip *pchip, unsigned int reg,
+  unsigned int *val)
+{
+   return regmap_read(pchip-regmap, reg, val);
+}
+
+/**
+ *lp8755_write : write a single register value to lp8755.
+ */
+static int lp8755_write(struct lp8755_chip *pchip, unsigned int reg,
+   unsigned int val)
+{
+   return regmap_write(pchip-regmap, reg, val);
+}
+
+/**
+ *lp8755_update_bits : set the values of bit fields in lp8755 register.
+ */
+static int lp8755_update_bits(struct lp8755_chip *pchip, unsigned int reg,
+ unsigned int mask, unsigned int val)
+{
+   return regmap_update_bits(pchip-regmap, reg, mask, val);
+}
+
+static int lp8755_buck_enable_time(struct regulator_dev *rdev)
+{
+   int ret;
+   unsigned int regval;
+   enum lp8755_bucks id = rdev_get_id(rdev);
+   struct lp8755_chip *pchip = rdev_get_drvdata(rdev);
+
+   ret = lp8755_read(pchip, 0x12 + id, regval);
+   if (ret  0) {
+   dev_err(pchip-dev, i2c acceess error %s\n, __func__);
+   return ret;
+   }
+   return (regval  0xff) * 100;

Re: [PATCH v1 resend] regulator: new driver for LP8755

2012-12-05 Thread Mark Brown
On Thu, Dec 06, 2012 at 02:07:43PM +0900, Daniel Jeong wrote:
 This driver is a general version for lp8755 regulator driver of TI.
 
 LP8755 :
 The LP8755 is a high performance power management unit.It contains
 six step-down DC-DC converters which can can be filexibly bundled
 together in multiphase converters as required by application.
 www.ti.com

You've resent this after about 24 hours, please allow sane times for a
response.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v1 resend] regulator: new driver for LP8755

2012-12-05 Thread Jeong, Daniel

From: Mark Brown [mailto:broo...@opensource.wolfsonmicro.com] 
Sent: Thursday, December 06, 2012 2:34 PM
To: Daniel Jeong
Cc: Girdwood, Liam; Jeong, Daniel; linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 resend] regulator: new driver for LP8755

On Thu, Dec 06, 2012 at 02:07:43PM +0900, Daniel Jeong wrote:
 This driver is a general version for lp8755 regulator driver of TI.
 
 LP8755 :
 The LP8755 is a high performance power management unit.It contains six 
 step-down DC-DC converters which can can be filexibly bundled together 
 in multiphase converters as required by application.
 www.ti.com

You've resent this after about 24 hours, please allow sane times for a 
response.

Sorry. I mis-typed the email address so we couldn't find it at lkml. 

So I sent it again but it's same patch file(source doesn't changed).

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/