S5PC210: universal: update support pmic for c210 universal board
Subsystems (3)
PATCH v2 1/1 S5PC210: universal: update support pmic for c210 universal board
This patch supports pmic for c210 universal board.
I modified to c210 irqs style and removed useless header file.
Thank you,
Donghwa Lee
--- arch/arm/mach-s5pv310/Kconfig | 5 + arch/arm/mach-s5pv310/mach-universal_c210.c | 690 +++++++++++++++++++++++++++ 2 files changed, 695 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv310/Kconfig +5 -0
@@ -87,7 +87,12 @@ config MACH_UNIVERSAL_C210 select S3C_DEV_HSMMC3 select S5PV310_SETUP_SDHCI select S3C_DEV_I2C1 + select S3C_DEV_I2C5 select S5PV310_SETUP_I2C1 + select S5PV310_SETUP_I2C5 + select SPARSE_IRQ + select HAVE_SPARSE_IRQ + select HAVE_GENERIC_HARDIRQS help Machine support for Samsung Mobile Universal S5PC210 Reference Board. S5PC210(MCP) is one of package option of S5PV310
arch/arm/mach-s5pv310/mach-universal_c210.c +690 -0
738 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH v2 1/1 S5PC210: universal: update support pmic for c210 universal board
arch/arm/mach-s5pv310/Kconfig config MACH_UNIVERSAL_C210 · line 95
Quoted 2 lines · Donghwa Lee
arch/arm/mach-s5pv310/Kconfig +2
-0+ select HAVE_SPARSE_IRQ + select HAVE_GENERIC_HARDIRQS
I really would expect to see these controlled by the generic support for the CPU or CPU architecture rather than by an individual machine - they're properties of the core IRQ infrastructure for the system.
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 89
Quoted 7 lines
arch/arm/mach-s5pv310/mach-universal_c210.c +7
-0+/* I2C5: PMICs LP3974, MAX8952 */ +static struct regulator_consumer_supply max8952_consumer[] = { + { + .supply ="varm_1.2v_c210" , + }, { + .supply ="vdd_arm" , + },
This looks very suspicious - you've got two supplies, both of which look like the CPU core rail provided by the same regulator, one of which looks like it's got the name of the supply hard coded into it. What are these two supplies exactly?
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 113
Quoted 6 lines
arch/arm/mach-s5pv310/mach-universal_c210.c +6
-0+ .reg_data = { + .constraints = { + .name = "VARM_1.2V", + .min_uV = 770000, + .max_uV = 1400000, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
Interesting name for a supply that can change voltage :)
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 142
Quoted 5 lines
arch/arm/mach-s5pv310/mach-universal_c210.c +5
-0+static struct regulator_consumer_supply lp3974_buck2_consumer[] = { + { + .supply ="vg3d_1.2v_c210" , + }, +};
This and most of the other consumers you're defining look like they're actually the names for the relevant rails rather than supplies for individual devices. You shouldn't do this, supplies should be actual supplies on individual consumers - probably most of these consumers should just be removed. You can name the supplies for UI purposes using the .name field in the constraints.
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 210
Quoted 8 lines
arch/arm/mach-s5pv310/mach-universal_c210.c +8
-0+static struct regulator_consumer_supply lp3974_ldo13_consumer[] = { +REGULATOR_SUPPLY ("vhsic" ,NULL ), +}; + +static struct regulator_consumer_supply lp3974_ldo14_consumer[] = { + { + .supply ="cam_i_host_1.8v" , + },
There's also a mix of regulator_consumer_supply and open coding, please be consistent.
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 255
Quoted 7 lines
arch/arm/mach-s5pv310/mach-universal_c210.c +7
-0+static struct regulator_init_data lp3974_buck1_data = { + .constraints = { + .name ="VINT_1.1V" , + .min_uV =750000 , + .max_uV =1500000 , + .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE | +REGULATOR_CHANGE_STATUS ,
Can you really turn off the VINT regulator at runtime? I'd expect that to crash the processor. Similarly for many of the other supplies.
PATCH v2 1/1 S5PC210: universal: update support pmic for c210 universal board
Quoted 8 lines · Mark Brown
arch/arm/mach-s5pv310/Kconfig config MACH_UNIVERSAL_C210 · line 95
Quoted 2 lines · Donghwa Lee
arch/arm/mach-s5pv310/Kconfig +2
-0+ select HAVE_SPARSE_IRQ + select HAVE_GENERIC_HARDIRQSI really would expect to see these controlled by the generic support for the CPU or CPU architecture rather than by an individual machine - they're properties of the core IRQ infrastructure for the system.
Yes, you're right. i will modify it next patch.
Quoted 12 lines
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 89
Quoted 7 lines
arch/arm/mach-s5pv310/mach-universal_c210.c +7
-0+/* I2C5: PMICs LP3974, MAX8952 */ +static struct regulator_consumer_supply max8952_consumer[] = { + { + .supply ="varm_1.2v_c210" , + }, { + .supply ="vdd_arm" , + },This looks very suspicious - you've got two supplies, both of which look like the CPU core rail provided by the same regulator, one of which looks like it's got the name of the supply hard coded into it. What are these two supplies exactly?
I will remove "vdd_arm" next patch.
Quoted 8 lines
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 113
Quoted 6 lines
arch/arm/mach-s5pv310/mach-universal_c210.c +6
-0+ .reg_data = { + .constraints = { + .name = "VARM_1.2V", + .min_uV = 770000, + .max_uV = 1400000, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,Interesting name for a supply that can change voltage :)
1.2V is default voltage. If it is needed , volatage can be changed. Is the name changed?
Quoted 12 lines
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 142
Quoted 5 lines
arch/arm/mach-s5pv310/mach-universal_c210.c +5
-0+static struct regulator_consumer_supply lp3974_buck2_consumer[] = { + { + .supply ="vg3d_1.2v_c210" , + }, +};This and most of the other consumers you're defining look like they're actually the names for the relevant rails rather than supplies for individual devices. You shouldn't do this, supplies should be actual supplies on individual consumers - probably most of these consumers should just be removed. You can name the supplies for UI purposes using the .name field in the constraints.
Supplies name of this patch is defined in the schematic diagram. Could you suggest the name for UI purposes?
Quoted 11 lines
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 210
Quoted 8 lines
arch/arm/mach-s5pv310/mach-universal_c210.c +8
-0+static struct regulator_consumer_supply lp3974_ldo13_consumer[] = { +REGULATOR_SUPPLY ("vhsic" ,NULL ), +}; + +static struct regulator_consumer_supply lp3974_ldo14_consumer[] = { + { + .supply ="cam_i_host_1.8v" , + },There's also a mix of
regulator_consumer_supplyand open coding, please be consistent.
.
Quoted 10 lines
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 255
Quoted 7 lines
arch/arm/mach-s5pv310/mach-universal_c210.c +7
-0+static struct regulator_init_data lp3974_buck1_data = { + .constraints = { + .name ="VINT_1.1V" , + .min_uV =750000 , + .max_uV =1500000 , + .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE | +REGULATOR_CHANGE_STATUS ,Can you really turn off the VINT regulator at runtime? I'd expect that to crash the processor. Similarly for many of the other supplies.
If it turns off at run time, it would be crash the processor, but, it will be turn off only when executing SLEEP, maybe no problem.
Thank you,
Donghwa Lee
PATCH v2 1/1 S5PC210: universal: update support pmic for c210 universal board
Quoted 14 lines · Donghwa Lee
Quoted 12 lines · Mark Brown
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 89
Quoted 6 lines · Donghwa Lee
arch/arm/mach-s5pv310/mach-universal_c210.c +6
-0+static struct regulator_consumer_supply max8952_consumer[] = { + { + .supply ="varm_1.2v_c210" , + }, { + .supply ="vdd_arm" , + },This looks very suspicious - you've got two supplies, both of which look like the CPU core rail provided by the same regulator, one of which looks like it's got the name of the supply hard coded into it. What are these two supplies exactly?
Quoted 1 line
I will remove "
vdd_arm" next patch.
I think that's the wrong one to remove; see below.
Quoted 6 lines
Quoted 3 lines
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 110
Quoted 1 line
arch/arm/mach-s5pv310/mach-universal_c210.c +1
-0+ .name = "VARM_1.2V",Interesting name for a supply that can change voltage :)
1.2V is default voltage. If it is needed , volatage can be changed. Is the name changed?
The name is fine, it's just amusing.
Quoted 12 lines
Quoted 11 lines
arch/arm/mach-s5pv310/mach-universal_c210.c static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { · line 141
Quoted 4 lines
arch/arm/mach-s5pv310/mach-universal_c210.c +4
-0+static struct regulator_consumer_supply lp3974_buck2_consumer[] = { + { + .supply ="vg3d_1.2v_c210" , + },This and most of the other consumers you're defining look like they're actually the names for the relevant rails rather than supplies for individual devices. You shouldn't do this, supplies should be actual supplies on individual consumers - probably most of these consumers should just be removed. You can name the supplies for UI purposes using the .name field in the constraints.
Quoted 2 lines
Supplies name of this patch is defined in the schematic diagram. Could you suggest the name for UI purposes?
You're misunderstanding what supplies are. The supplies define how the regulators are connected to the other devices on the board, they allow other devices to request supplies in terms of the name the device itself uses for the supply (eg, "DBVDD") rather than in terms of a board specific name (like what you've got above). This is why there's a device field - it's to specify the device that the supplies are in terms of.
Quoted 5 lines
Quoted 2 lines
Can you really turn off the VINT regulator at runtime? I'd expect that to crash the processor. Similarly for many of the other supplies.
If it turns off at run time, it would be crash the processor, but, it will be turn off only when executing SLEEP, maybe no problem.
That's a separate thing, no need to enable change status for that.