Re: [PATCH v3 5/5] regulator: Regulator driver for the Qualcomm RPM

2015-08-15 Thread Mark Brown
On Fri, Aug 14, 2015 at 09:59:50PM -0700, Bjorn Andersson wrote:
> On Fri 14 Aug 19:14 PDT 2015, Mark Brown wrote:

> > Please submit any patches you think should be included in the upstream
> > kernel using the process documented in SubmittingPatches.

> I'm sorry, I thought I did and Andy's comment was to inform you that the
> other 4 patches in this series have been merged.

> Do you want me to resend this single patch on its own? Or is there
> anything else you would like me to do with it?

Yes, you need to send patches to me if you want me to consider applying
them.  Sending me content free pings mostly just adds to the mail
volume, I can't apply a content free ping and given that it's a reply to
something with my Reviewed-by on it's not even something I replied to.

If I gave a Reviewed-by for the patch it's presumably because there are
some dependencies that prevented me just applying it and I was expecting
it to go in with the rest of the series, are there any actual
dependencies here or have the dependencies reached Linus' tree?


signature.asc
Description: Digital signature


Re: [PATCH v3 5/5] regulator: Regulator driver for the Qualcomm RPM

2015-08-14 Thread Bjorn Andersson
On Fri 14 Aug 19:14 PDT 2015, Mark Brown wrote:

> On Fri, Aug 14, 2015 at 11:58:35AM -0500, Andy Gross wrote:
> > On Mon, Jul 27, 2015 at 08:20:33PM -0700, Bjorn Andersson wrote:
> > > Driver for regulators exposed by the Resource Power Manager (RPM) found
> > > in devices based on Qualcomm 8974 and newer platforms.
> 
> > > Reviewed-by: Mark Brown 
> > > Signed-off-by: Bjorn Andersson 
> 
> > Mark/Liam, can you please pick this up.  The dependencies for this have 
> > been merged
> > in by the arm/soc maintainers.
> 
> > Acked-by: Andy Gross 
> 
> Please submit any patches you think should be included in the upstream
> kernel using the process documented in SubmittingPatches.

I'm sorry, I thought I did and Andy's comment was to inform you that the
other 4 patches in this series have been merged.

Do you want me to resend this single patch on its own? Or is there
anything else you would like me to do with it?

Regards,
Bjorn
--
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 v3 5/5] regulator: Regulator driver for the Qualcomm RPM

2015-08-14 Thread Mark Brown
On Fri, Aug 14, 2015 at 11:58:35AM -0500, Andy Gross wrote:
> On Mon, Jul 27, 2015 at 08:20:33PM -0700, Bjorn Andersson wrote:
> > Driver for regulators exposed by the Resource Power Manager (RPM) found
> > in devices based on Qualcomm 8974 and newer platforms.

> > Reviewed-by: Mark Brown 
> > Signed-off-by: Bjorn Andersson 

> Mark/Liam, can you please pick this up.  The dependencies for this have been 
> merged
> in by the arm/soc maintainers.

> Acked-by: Andy Gross 

Please submit any patches you think should be included in the upstream
kernel using the process documented in SubmittingPatches.


signature.asc
Description: Digital signature


Re: [PATCH v3 5/5] regulator: Regulator driver for the Qualcomm RPM

2015-08-14 Thread Tim Bird
On Fri, Aug 14, 2015 at 9:58 AM, Andy Gross  wrote:
> On Mon, Jul 27, 2015 at 08:20:33PM -0700, Bjorn Andersson wrote:
>> Driver for regulators exposed by the Resource Power Manager (RPM) found
>> in devices based on Qualcomm 8974 and newer platforms.
>>
>> Reviewed-by: Mark Brown 
>> Signed-off-by: Bjorn Andersson 
>> ---
>
> Mark/Liam, can you please pick this up.  The dependencies for this have been 
> merged
> in by the arm/soc maintainers.
>
> Acked-by: Andy Gross 

I'd like to see these go in as well, though I realize we're starting
to get pretty close to the merge window.
These regulators are the last thing outstanding to get the USB driver
working completely in mainline for
the Xperia Z1 and the dragonboard (800).

FWIW...

Tested-by: Tim Bird 
 -- Tim
--
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 v3 5/5] regulator: Regulator driver for the Qualcomm RPM

2015-08-14 Thread Andy Gross
On Mon, Jul 27, 2015 at 08:20:33PM -0700, Bjorn Andersson wrote:
> Driver for regulators exposed by the Resource Power Manager (RPM) found
> in devices based on Qualcomm 8974 and newer platforms.
> 
> Reviewed-by: Mark Brown 
> Signed-off-by: Bjorn Andersson 
> ---

Mark/Liam, can you please pick this up.  The dependencies for this have been 
merged
in by the arm/soc maintainers.

Acked-by: Andy Gross 

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

--
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 v3 5/5] regulator: Regulator driver for the Qualcomm RPM

2015-07-27 Thread Bjorn Andersson
Driver for regulators exposed by the Resource Power Manager (RPM) found
in devices based on Qualcomm 8974 and newer platforms.

Reviewed-by: Mark Brown 
Signed-off-by: Bjorn Andersson 
---

Changes since v2:
- Updated Kconfig dependency to follow smd's move from mfd

 drivers/regulator/Kconfig  |  12 ++
 drivers/regulator/Makefile |   1 +
 drivers/regulator/qcom_smd-regulator.c | 349 +
 3 files changed, 362 insertions(+)
 create mode 100644 drivers/regulator/qcom_smd-regulator.c

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index a7b81f0185b5..dd991d08d778 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -514,6 +514,18 @@ config REGULATOR_QCOM_RPM
  Qualcomm RPM as a module. The module will be named
  "qcom_rpm-regulator".
 
+config REGULATOR_QCOM_SMD_RPM
+   tristate "Qualcomm SMD based RPM regulator driver"
+   depends on QCOM_SMD_RPM
+   help
+ If you say yes to this option, support will be included for the
+ regulators exposed by the Resource Power Manager found in Qualcomm
+ 8974 based devices.
+
+ Say M here if you want to include support for the regulators on the
+ Qualcomm RPM as a module. The module will be named
+ "qcom_smd-regulator".
+
 config REGULATOR_QCOM_SPMI
tristate "Qualcomm SPMI regulator driver"
depends on SPMI || COMPILE_TEST
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 6429e629dcb6..a00cffcf6bf9 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -61,6 +61,7 @@ obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o
 obj-$(CONFIG_REGULATOR_MC13XXX_CORE) +=  mc13xxx-regulator-core.o
 obj-$(CONFIG_REGULATOR_MT6397) += mt6397-regulator.o
 obj-$(CONFIG_REGULATOR_QCOM_RPM) += qcom_rpm-regulator.o
+obj-$(CONFIG_REGULATOR_QCOM_SMD_RPM) += qcom_smd-regulator.o
 obj-$(CONFIG_REGULATOR_QCOM_SPMI) += qcom_spmi-regulator.o
 obj-$(CONFIG_REGULATOR_PALMAS) += palmas-regulator.o
 obj-$(CONFIG_REGULATOR_PFUZE100) += pfuze100-regulator.o
diff --git a/drivers/regulator/qcom_smd-regulator.c 
b/drivers/regulator/qcom_smd-regulator.c
new file mode 100644
index ..9d093ae36ba7
--- /dev/null
+++ b/drivers/regulator/qcom_smd-regulator.c
@@ -0,0 +1,349 @@
+/*
+ * Copyright (c) 2015, Sony Mobile Communications AB.
+ * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct qcom_rpm_reg {
+   struct device *dev;
+
+   struct qcom_smd_rpm *rpm;
+
+   u32 type;
+   u32 id;
+
+   struct regulator_desc desc;
+
+   int is_enabled;
+   int uV;
+};
+
+struct rpm_regulator_req {
+   u32 key;
+   u32 nbytes;
+   u32 value;
+};
+
+#define RPM_KEY_SWEN   0x6e657773 /* "swen" */
+#define RPM_KEY_UV 0x7675 /* "uv" */
+#define RPM_KEY_MA 0x616d /* "ma" */
+
+static int rpm_reg_write_active(struct qcom_rpm_reg *vreg,
+   struct rpm_regulator_req *req,
+   size_t size)
+{
+   return qcom_rpm_smd_write(vreg->rpm,
+ QCOM_SMD_RPM_ACTIVE_STATE,
+ vreg->type,
+ vreg->id,
+ req, size);
+}
+
+static int rpm_reg_enable(struct regulator_dev *rdev)
+{
+   struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev);
+   struct rpm_regulator_req req;
+   int ret;
+
+   req.key = RPM_KEY_SWEN;
+   req.nbytes = sizeof(u32);
+   req.value = 1;
+
+   ret = rpm_reg_write_active(vreg, &req, sizeof(req));
+   if (!ret)
+   vreg->is_enabled = 1;
+
+   return ret;
+}
+
+static int rpm_reg_is_enabled(struct regulator_dev *rdev)
+{
+   struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev);
+
+   return vreg->is_enabled;
+}
+
+static int rpm_reg_disable(struct regulator_dev *rdev)
+{
+   struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev);
+   struct rpm_regulator_req req;
+   int ret;
+
+   req.key = RPM_KEY_SWEN;
+   req.nbytes = sizeof(u32);
+   req.value = 0;
+
+   ret = rpm_reg_write_active(vreg, &req, sizeof(req));
+   if (!ret)
+   vreg->is_enabled = 0;
+
+   return ret;
+}
+
+static int rpm_reg_get_voltage(struct regulator_dev *rdev)
+{
+   struct qcom_rpm_reg *vreg = rdev_get_drvda