U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lokesh Vutla <lokeshvutla@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] ARM: OMAP5+: vcores: Drop unnecessary #ifndefs
Date: Wed, 17 Aug 2016 16:25:35 +0530	[thread overview]
Message-ID: <20160817105536.329-2-lokeshvutla@ti.com> (raw)
In-Reply-To: <20160817105536.329-1-lokeshvutla@ti.com>

gpio_en field is introduced to detect if pmic is controlled by GPIO.
Make this field 0 on all TPS659* pmics available on DRA7/OMAP5 based platforms
and remove the #ifndefs.

Reviewed-by:  Keerthy <j-keerthy@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/cpu/armv7/omap-common/clocks-common.c | 7 +------
 arch/arm/cpu/armv7/omap5/hw_data.c             | 2 ++
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c
index 2de9935..7e5e752 100644
--- a/arch/arm/cpu/armv7/omap-common/clocks-common.c
+++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c
@@ -443,15 +443,12 @@ void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic)
 {
 	u32 offset_code;
 	u32 offset = volt_mv;
-#ifndef	CONFIG_DRA7XX
 	int ret = 0;
-#endif
 
 	if (!volt_mv)
 		return;
 
 	pmic->pmic_bus_init();
-#ifndef	CONFIG_DRA7XX
 	/* See if we can first get the GPIO if needed */
 	if (pmic->gpio_en)
 		ret = gpio_request(pmic->gpio, "PMIC_GPIO");
@@ -465,7 +462,7 @@ void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic)
 	/* Pull the GPIO low to select SET0 register, while we program SET1 */
 	if (pmic->gpio_en)
 		gpio_direction_output(pmic->gpio, 0);
-#endif
+
 	/* convert to uV for better accuracy in the calculations */
 	offset *= 1000;
 
@@ -476,10 +473,8 @@ void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic)
 
 	if (pmic->pmic_write(pmic->i2c_slave_addr, vcore_reg, offset_code))
 		printf("Scaling voltage failed for 0x%x\n", vcore_reg);
-#ifndef	CONFIG_DRA7XX
 	if (pmic->gpio_en)
 		gpio_direction_output(pmic->gpio, 1);
-#endif
 }
 
 static u32 optimize_vcore_voltage(struct volts const *v)
diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c b/arch/arm/cpu/armv7/omap5/hw_data.c
index a83f68c..fc99135 100644
--- a/arch/arm/cpu/armv7/omap5/hw_data.c
+++ b/arch/arm/cpu/armv7/omap5/hw_data.c
@@ -318,6 +318,7 @@ struct pmic_data palmas = {
 	.i2c_slave_addr	= SMPS_I2C_SLAVE_ADDR,
 	.pmic_bus_init	= sri2c_init,
 	.pmic_write	= omap_vc_bypass_send_value,
+	.gpio_en = 0,
 };
 
 /* The TPS659038 and TPS65917 are software-compatible, use common struct */
@@ -332,6 +333,7 @@ struct pmic_data tps659038 = {
 	.i2c_slave_addr	= TPS659038_I2C_SLAVE_ADDR,
 	.pmic_bus_init	= gpi2c_init,
 	.pmic_write	= palmas_i2c_write_u8,
+	.gpio_en = 0,
 };
 
 struct vcores_data omap5430_volts = {
-- 
2.9.3

  reply	other threads:[~2016-08-17 10:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 10:55 [U-Boot] [PATCH 0/2] ARM: OMAP4+: vcores: Make scale_vcores common Lokesh Vutla
2016-08-17 10:55 ` Lokesh Vutla [this message]
2016-08-19 19:54   ` [U-Boot] [PATCH 1/2] ARM: OMAP5+: vcores: Drop unnecessary #ifndefs Tom Rini
2016-08-21 15:09   ` [U-Boot] [U-Boot, " Tom Rini
2016-08-17 10:55 ` [U-Boot] [PATCH 2/2] ARM: OMAP4+: vcores: Remove duplicated code Lokesh Vutla
2016-08-19 19:55   ` Tom Rini
2016-08-21 15:09   ` [U-Boot] [U-Boot, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160817105536.329-2-lokeshvutla@ti.com \
    --to=lokeshvutla@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox