summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2015-07-08 15:57:51 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2015-07-08 15:57:51 +0200
commit26d82301d5b8b425f915776c4b86f856669c326d (patch)
tree94b5cb6385aac5f14e409f8b87df3066db9a18b6 /board
parent5e0c818ad6a13666e4cb0d1a7c1b97ff7649d175 (diff)
Apalis/Colibri iMX6: pf0100.c cleanup coding style
Diffstat (limited to 'board')
-rw-r--r--board/toradex/apalis_imx6/pf0100.c24
-rw-r--r--board/toradex/colibri_imx6/pf0100.c48
2 files changed, 29 insertions, 43 deletions
diff --git a/board/toradex/apalis_imx6/pf0100.c b/board/toradex/apalis_imx6/pf0100.c
index fbd4aa6c99..a52e1dfa1d 100644
--- a/board/toradex/apalis_imx6/pf0100.c
+++ b/board/toradex/apalis_imx6/pf0100.c
@@ -60,11 +60,9 @@ unsigned pmic_init(void)
for(i=0; i<16; i++)
printf("\t%x",i);
- for(j=0; j<0x80; )
- {
+ for(j=0; j<0x80; ) {
printf("\n%2x",j);
- for(i=0; i<16; i++)
- {
+ for(i=0; i<16; i++) {
i2c_read(PFUZE100_I2C_ADDR, j+i, 1, &val, 1);
printf("\t%2x", val);
}
@@ -79,11 +77,9 @@ unsigned pmic_init(void)
return 0;
}
- for(j=0x80; j<0x100; )
- {
+ for(j=0x80; j<0x100; ) {
printf("\n%2x",j);
- for(i=0; i<16; i++)
- {
+ for(i=0; i<16; i++) {
i2c_read(PFUZE100_I2C_ADDR, j+i, 1, &val, 1);
printf("\t%2x", val);
}
@@ -98,11 +94,9 @@ unsigned pmic_init(void)
return 0;
}
- for(j=0x80; j<0x100; )
- {
+ for(j=0x80; j<0x100; ) {
printf("\n%2x",j);
- for(i=0; i<16; i++)
- {
+ for(i=0; i<16; i++) {
i2c_read(PFUZE100_I2C_ADDR, j+i, 1, &val, 1);
printf("\t%2x", val);
}
@@ -182,7 +176,7 @@ int pf0100_prog(void)
return 1;
}
/* set up gpio to manipulate vprog, initially off */
- imx_iomux_v3_setup_multiple_pads(pmic_prog_pads,
+ imx_iomux_v3_setup_multiple_pads(pmic_prog_pads,
ARRAY_SIZE(pmic_prog_pads));
gpio_direction_output(PMIC_PROG_VOLTAGE, 0);
@@ -207,8 +201,8 @@ int pf0100_prog(void)
udelay(pmic_otp_prog[i].value * 1000);
break;
case pmic_vpgm:
- gpio_direction_output(IMX_GPIO_NR(2, 4),
- pmic_otp_prog[i].value);
+ gpio_direction_output(PMIC_PROG_VOLTAGE,
+ pmic_otp_prog[i].value);
break;
case pmic_pwr:
/* TODO */
diff --git a/board/toradex/colibri_imx6/pf0100.c b/board/toradex/colibri_imx6/pf0100.c
index e26b5b1d96..dbac981161 100644
--- a/board/toradex/colibri_imx6/pf0100.c
+++ b/board/toradex/colibri_imx6/pf0100.c
@@ -44,13 +44,11 @@ unsigned pmic_init(void)
return 0;
}
/* get device ident */
- if( i2c_read(PFUZE100_I2C_ADDR, PFUZE100_DEVICEID, 1, &devid, 1) < 0)
- {
+ if( i2c_read(PFUZE100_I2C_ADDR, PFUZE100_DEVICEID, 1, &devid, 1) < 0) {
puts("i2c pmic devid read failed\n");
return 0;
}
- if( i2c_read(PFUZE100_I2C_ADDR, PFUZE100_REVID, 1, &revid, 1) < 0)
- {
+ if( i2c_read(PFUZE100_I2C_ADDR, PFUZE100_REVID, 1, &revid, 1) < 0) {
puts("i2c pmic revid read failed\n");
return 0;
}
@@ -62,11 +60,9 @@ unsigned pmic_init(void)
for(i=0; i<16; i++)
printf("\t%x",i);
- for(j=0; j<0x80; )
- {
+ for(j=0; j<0x80; ) {
printf("\n%2x",j);
- for(i=0; i<16; i++)
- {
+ for(i=0; i<16; i++) {
i2c_read(PFUZE100_I2C_ADDR, j+i, 1, &val, 1);
printf("\t%2x", val);
}
@@ -75,17 +71,15 @@ unsigned pmic_init(void)
printf("\nEXT Page 1");
val = PFUZE100_PAGE_REGISTER_PAGE1;
- if( i2c_write(PFUZE100_I2C_ADDR, PFUZE100_PAGE_REGISTER, 1, &val, 1))
- {
+ if( i2c_write(PFUZE100_I2C_ADDR, PFUZE100_PAGE_REGISTER, 1,
+ &val, 1)) {
puts("i2c write failed\n");
return 0;
}
- for(j=0x80; j<0x100; )
- {
+ for(j=0x80; j<0x100; ) {
printf("\n%2x",j);
- for(i=0; i<16; i++)
- {
+ for(i=0; i<16; i++) {
i2c_read(PFUZE100_I2C_ADDR, j+i, 1, &val, 1);
printf("\t%2x", val);
}
@@ -94,8 +88,8 @@ unsigned pmic_init(void)
printf("\nEXT Page 2");
val = PFUZE100_PAGE_REGISTER_PAGE2;
- if( i2c_write(PFUZE100_I2C_ADDR, PFUZE100_PAGE_REGISTER, 1, &val, 1))
- {
+ if( i2c_write(PFUZE100_I2C_ADDR, PFUZE100_PAGE_REGISTER, 1,
+ &val, 1)) {
puts("i2c write failed\n");
return 0;
}
@@ -120,24 +114,21 @@ unsigned pmic_init(void)
puts("i2c write failed\n");
return 0;
}
- if( i2c_read(PFUZE100_I2C_ADDR, PFUZE100_FUSE_POR1, 1, &val, 1) < 0)
- {
+ if( i2c_read(PFUZE100_I2C_ADDR, PFUZE100_FUSE_POR1, 1, &val, 1) < 0) {
puts("i2c fuse_por read failed\n");
return 0;
}
if(val & PFUZE100_FUSE_POR_M)
programmed++;
- if( i2c_read(PFUZE100_I2C_ADDR, PFUZE100_FUSE_POR2, 1, &val, 1) < 0)
- {
+ if( i2c_read(PFUZE100_I2C_ADDR, PFUZE100_FUSE_POR2, 1, &val, 1) < 0) {
puts("i2c fuse_por read failed\n");
return programmed;
}
if(val & PFUZE100_FUSE_POR_M)
programmed++;
- if( i2c_read(PFUZE100_I2C_ADDR, PFUZE100_FUSE_POR3, 1, &val, 1) < 0)
- {
+ if( i2c_read(PFUZE100_I2C_ADDR, PFUZE100_FUSE_POR3, 1, &val, 1) < 0) {
puts("i2c fuse_por read failed\n");
return programmed;
}
@@ -170,7 +161,8 @@ int pf0100_prog(void)
return 1;
}
/* set up gpio to manipulate vprog, initially off */
- imx_iomux_v3_setup_multiple_pads(pmic_prog_pads, ARRAY_SIZE(pmic_prog_pads));
+ imx_iomux_v3_setup_multiple_pads(pmic_prog_pads,
+ ARRAY_SIZE(pmic_prog_pads));
gpio_direction_output(PMIC_PROG_VOLTAGE, 0);
if(!(0 == i2c_set_bus_num(bus) && (0 == i2c_probe(PFUZE100_I2C_ADDR))))
@@ -184,10 +176,9 @@ int pf0100_prog(void)
case pmic_i2c:
val = (unsigned char) (pmic_otp_prog[i].value & 0xff);
if( i2c_write(PFUZE100_I2C_ADDR, pmic_otp_prog[i].reg,
- 1, &val, 1))
- {
- printf("i2c write failed, reg 0x%2x, value0x%2x\n",
- pmic_otp_prog[i].reg, val);
+ 1, &val, 1)) {
+ printf("i2c write failed, reg 0x%2x, value"
+ "0x%2x\n", pmic_otp_prog[i].reg, val);
return 1;
}
break;
@@ -195,7 +186,8 @@ int pf0100_prog(void)
udelay(pmic_otp_prog[i].value * 1000);
break;
case pmic_vpgm:
- gpio_direction_output(PMIC_PROG_VOLTAGE , pmic_otp_prog[i].value);
+ gpio_direction_output(PMIC_PROG_VOLTAGE,
+ pmic_otp_prog[i].value);
break;
case pmic_pwr:
/* TODO */