diff mbox

[v2,11/21] ARM: pxa: magician: Add MAX1586 Vcore regulator support

Message ID 55D259CC.6040307@tul.cz (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Petr Cvek Aug. 17, 2015, 10:01 p.m. UTC
Add support for MAX1586 Vcore regulator.

Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
 arch/arm/mach-pxa/magician.c | 50 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

Comments

Robert Jarzmik Aug. 20, 2015, 7:32 p.m. UTC | #1
Petr Cvek <petr.cvek@tul.cz> writes:

> Add support for MAX1586 Vcore regulator.
>
> Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
I'll leave that for a week and if no objections queue it.

I would have expected a better commit message : for example, from your patch I
deduce magician has a 1587 regulator, not a 1586 one : that deserves a small
mention in the commit message. Moreover, the Maxim has 2 outputs : one is
connected to VCC_Core of the SoC, what about the other output ?  Is it unknown,
or do you know but don't use it ?

Cheers.

--
Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Petr Cvek Aug. 20, 2015, 10:33 p.m. UTC | #2
Dne 20.8.2015 v 21:32 Robert Jarzmik napsal(a):
> Petr Cvek <petr.cvek@tul.cz> writes:
> 
>> Add support for MAX1586 Vcore regulator.
>>
>> Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
> I'll leave that for a week and if no objections queue it.
> 
> I would have expected a better commit message : for example, from your patch I
> deduce magician has a 1587 regulator, not a 1586 one : that deserves a small
> mention in the commit message. Moreover, the Maxim has 2 outputs : one is
> connected to VCC_Core of the SoC, what about the other output ?  Is it unknown,
> or do you know but don't use it ?
> 
You mean V6 - Usim? MAX1587 does not have this pin implemented. I will note it in commit message.


> Cheers.
> 
> --
> Robert
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Robert Jarzmik Aug. 28, 2015, 8:49 a.m. UTC | #3
Petr Cvek <petr.cvek@tul.cz> writes:

> Dne 20.8.2015 v 21:32 Robert Jarzmik napsal(a):
>> Petr Cvek <petr.cvek@tul.cz> writes:
>> 
>>> Add support for MAX1586 Vcore regulator.
>>>
>>> Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
>> I'll leave that for a week and if no objections queue it.
>> 
>> I would have expected a better commit message : for example, from your patch I
>> deduce magician has a 1587 regulator, not a 1586 one : that deserves a small
>> mention in the commit message. Moreover, the Maxim has 2 outputs : one is
>> connected to VCC_Core of the SoC, what about the other output ?  Is it unknown,
>> or do you know but don't use it ?
>> 
> You mean V6 - Usim? MAX1587 does not have this pin implemented. I will note it
> in commit message.
Excellent, thanks.

Cheers.
diff mbox

Patch

diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 9decd86..8ca0b67 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -96,6 +96,8 @@ 
 
 #include <sound/uda1380.h>
 
+#include <linux/regulator/max1586.h>
+
 #include "devices.h"
 #include "generic.h"
 
@@ -864,6 +866,52 @@  static struct platform_device vads7846_device = {
 };
 
 /*
+ * Vcore regulator MAX1587A
+ */
+
+static struct regulator_consumer_supply magician_max1587a_consumers[] = {
+	REGULATOR_SUPPLY("vcc_core", NULL),
+};
+
+static struct regulator_init_data magician_max1587a_v3_info = {
+	.constraints = {
+		.name		= "vcc_core range",
+		.min_uV		= 700000,
+		.max_uV		= 1500000,
+		.always_on	= 1,
+		.valid_ops_mask	= REGULATOR_CHANGE_VOLTAGE,
+	},
+	.consumer_supplies	= magician_max1587a_consumers,
+	.num_consumer_supplies	= ARRAY_SIZE(magician_max1587a_consumers),
+};
+
+static struct max1586_subdev_data magician_max1587a_subdevs[] = {
+	{
+		.name		= "vcc_core",
+		.id		= MAX1586_V3,
+		.platform_data	= &magician_max1587a_v3_info,
+	}
+};
+
+static struct max1586_platform_data magician_max1587a_info = {
+	.subdevs     = magician_max1587a_subdevs,
+	.num_subdevs = ARRAY_SIZE(magician_max1587a_subdevs),
+	/*
+	 * NOTICE measured directly on the PCB (board_id == 0x3a), but
+	 * if R24 is present, it will boost the voltage
+	 * (write 1.475V, get 1.645V and smoke)
+	 */
+	.v3_gain     = MAX1586_GAIN_NO_R24,
+};
+
+static struct i2c_board_info magician_pwr_i2c_board_info[] __initdata = {
+	{
+		I2C_BOARD_INFO("max1586", 0x14),
+		.platform_data	= &magician_max1587a_info,
+	},
+};
+
+/*
  * MMC/SD
  */
 
@@ -1173,6 +1221,8 @@  static void __init magician_init(void)
 	pxa_set_i2c_info(&i2c_info);
 	i2c_register_board_info(0,
 		ARRAY_AND_SIZE(magician_audio_i2c_devices));
+	i2c_register_board_info(1,
+		ARRAY_AND_SIZE(magician_pwr_i2c_board_info));
 
 	pxa_set_mci_info(&magician_mci_info);
 	pxa_set_ohci_info(&magician_ohci_info);