summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2016-09-20 10:13:51 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2016-09-29 06:04:33 +0200
commitfa07dde8ce22e32bb56fa854554b905a1f8077a2 (patch)
tree6c00efcfaccabe084c6a7110e636369f1331bb37
parent3f42c624fa03c30b546fc4eab6f1ae376291660d (diff)
board/toradex/apalis_imx6: whitespace fixup
Cleanup whitespace found when preparing patches for mainline. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r--board/toradex/apalis_imx6/apalis_imx6.c48
-rw-r--r--board/toradex/apalis_imx6/do_fuse.c5
-rw-r--r--board/toradex/apalis_imx6/pf0100.c55
-rw-r--r--board/toradex/apalis_imx6/pf0100.h5
-rw-r--r--board/toradex/apalis_imx6/pf0100_otp.inc2
5 files changed, 58 insertions, 57 deletions
diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c
index 0d979cd6fc..faedc5a4c0 100644
--- a/board/toradex/apalis_imx6/apalis_imx6.c
+++ b/board/toradex/apalis_imx6/apalis_imx6.c
@@ -257,15 +257,16 @@ static int reset_enet_phy (struct mii_dev *bus)
/* mux the Apalis GPIO pins to GPIO, so they can be used from the U-Boot commandline */
iomux_v3_cfg_t const gpio_pads[] = {
- MX6_PAD_NANDF_D4__GPIO2_IO04 | MUX_PAD_CTRL(WEAK_PULLUP), /* Apalis GPIO1 */
- MX6_PAD_NANDF_D5__GPIO2_IO05 | MUX_PAD_CTRL(WEAK_PULLUP), /* Apalis GPIO2 */
- MX6_PAD_NANDF_D6__GPIO2_IO06 | MUX_PAD_CTRL(WEAK_PULLUP), /* Apalis GPIO3 */
- MX6_PAD_NANDF_D7__GPIO2_IO07 | MUX_PAD_CTRL(WEAK_PULLUP), /* Apalis GPIO4 */
- MX6_PAD_NANDF_RB0__GPIO6_IO10 | MUX_PAD_CTRL(WEAK_PULLUP), /* Apalis GPIO5 */
- MX6_PAD_NANDF_WP_B__GPIO6_IO09 | MUX_PAD_CTRL(WEAK_PULLUP), /* Apalis GPIO6 */
- MX6_PAD_GPIO_2__GPIO1_IO02 | MUX_PAD_CTRL(WEAK_PULLDOWN), /* Apalis GPIO7 */
- MX6_PAD_GPIO_6__GPIO1_IO06 | MUX_PAD_CTRL(WEAK_PULLUP), /* Apalis GPIO8 */
- MX6_PAD_GPIO_4__GPIO1_IO04 | MUX_PAD_CTRL(WEAK_PULLUP), /* Power Button */
+ /* Apalis GPIO1 - GPIO8 */
+ MX6_PAD_NANDF_D4__GPIO2_IO04 | MUX_PAD_CTRL(WEAK_PULLUP),
+ MX6_PAD_NANDF_D5__GPIO2_IO05 | MUX_PAD_CTRL(WEAK_PULLUP),
+ MX6_PAD_NANDF_D6__GPIO2_IO06 | MUX_PAD_CTRL(WEAK_PULLUP),
+ MX6_PAD_NANDF_D7__GPIO2_IO07 | MUX_PAD_CTRL(WEAK_PULLUP),
+ MX6_PAD_NANDF_RB0__GPIO6_IO10 | MUX_PAD_CTRL(WEAK_PULLUP),
+ MX6_PAD_NANDF_WP_B__GPIO6_IO09 | MUX_PAD_CTRL(WEAK_PULLUP),
+ MX6_PAD_GPIO_2__GPIO1_IO02 | MUX_PAD_CTRL(WEAK_PULLDOWN),
+ MX6_PAD_GPIO_6__GPIO1_IO06 | MUX_PAD_CTRL(WEAK_PULLUP),
+ MX6_PAD_GPIO_4__GPIO1_IO04 | MUX_PAD_CTRL(WEAK_PULLUP),
};
static void setup_iomux_gpio(void)
@@ -289,7 +290,7 @@ iomux_v3_cfg_t const usb_pads[] = {
};
/*
- * If UARTs are used in DTE mode, switch the mode on all UARTs before
+ * UARTs are used in DTE mode, switch the mode on all UARTs before
* any pinmuxing connects a (DCE) output to a transceiver output.
*/
#define UFCR 0x90 /* FIFO Control Register */
@@ -313,13 +314,15 @@ static void setup_dcemode_uart(void)
static void setup_iomux_dte_uart(void)
{
setup_dtemode_uart();
- imx_iomux_v3_setup_multiple_pads(uart1_pads_dte, ARRAY_SIZE(uart1_pads_dte));
+ imx_iomux_v3_setup_multiple_pads(uart1_pads_dte,
+ ARRAY_SIZE(uart1_pads_dte));
}
static void setup_iomux_dce_uart(void)
{
setup_dcemode_uart();
- imx_iomux_v3_setup_multiple_pads(uart1_pads_dce, ARRAY_SIZE(uart1_pads_dce));
+ imx_iomux_v3_setup_multiple_pads(uart1_pads_dce,
+ ARRAY_SIZE(uart1_pads_dce));
}
#ifdef CONFIG_USB_EHCI_MX6
@@ -408,8 +411,8 @@ int board_mmc_init(bd_t *bis)
break;
default:
printf("Warning: you configured more USDHC controllers"
- "(%d) then supported by the board (%d)\n",
- index + 1, CONFIG_SYS_FSL_USDHC_NUM);
+ "(%d) than supported by the board (%d)\n",
+ index + 1, CONFIG_SYS_FSL_USDHC_NUM);
return status;
}
@@ -574,9 +577,8 @@ static void do_enable_hdmi(struct display_info_t const *dev)
static int detect_i2c(struct display_info_t const *dev)
{
- return ((0 == i2c_set_bus_num(dev->bus))
- &&
- (0 == i2c_probe(dev->addr)));
+ return (0 == i2c_set_bus_num(dev->bus)) &&
+ (0 == i2c_probe(dev->addr));
}
static void enable_lvds(struct display_info_t const *dev)
@@ -782,7 +784,7 @@ static void setup_display(void)
int board_early_init_f(void)
{
imx_iomux_v3_setup_multiple_pads(pwr_intb_pads,
- ARRAY_SIZE(pwr_intb_pads));
+ ARRAY_SIZE(pwr_intb_pads));
#ifndef CONFIG_APALIS_IMX6_V1_0
setup_iomux_dte_uart();
#else
@@ -839,15 +841,15 @@ int board_late_init(void)
#endif
#ifndef CONFIG_APALIS_IMX6_V1_0
- if((rev & 0xfff0) == 0x0100) {
- char* fdt_env;
+ if ((rev & 0xfff0) == 0x0100) {
+ char *fdt_env;
/* reconfigure the UART to DCE mode dynamically if on V1.0 HW */
setup_iomux_dce_uart();
/* if using the default device tree, use version for V1.0 HW */
fdt_env = getenv("fdt_file");
- if((fdt_env != NULL) && (strcmp(FDT_FILE, fdt_env) == 0)) {
+ if ((fdt_env != NULL) && (strcmp(FDT_FILE, fdt_env) == 0)) {
setenv("fdt_file", FDT_FILE_V1_0);
printf("patching fdt_file to " FDT_FILE_V1_0 "\n");
#ifndef CONFIG_ENV_IS_NOWHERE
@@ -864,8 +866,8 @@ int board_late_init(void)
int checkboard_fallback(void)
{
printf("Model: Toradex Apalis iMX6 %s\n",
- (gd->ram_size == 0x80000000) ? "2GB" :
- (gd->ram_size == 0x40000000) ? "1GB" : "512MB");
+ (gd->ram_size == 0x80000000) ? "2GB" :
+ (gd->ram_size == 0x40000000) ? "1GB" : "512MB");
return 0;
}
diff --git a/board/toradex/apalis_imx6/do_fuse.c b/board/toradex/apalis_imx6/do_fuse.c
index c3e39839f3..754ad1ee0e 100644
--- a/board/toradex/apalis_imx6/do_fuse.c
+++ b/board/toradex/apalis_imx6/do_fuse.c
@@ -23,8 +23,7 @@ static int mfgr_fuse(void)
printf("Fuse 4, 3: %8x\n", val);
fuse_sense(4, 2, &val);
printf("Fuse 4, 2: %8x\n", val);
- if(val6 & 0x10)
- {
+ if (val6 & 0x10) {
puts("BT_FUSE_SEL already fused, will do nothing\n");
return CMD_RET_FAILURE;
}
@@ -72,7 +71,7 @@ int do_updt_fuse(cmd_tbl_t *cmdtp, int flag, int argc,
" Updating to fast boot mode prevents easy\n"
" downgrading to previous BSP versions.\n"
"\nReally perform this fuse programming? <y/N>\n");
- if (!confirm_yesno())
+ if (!confirm_yesno())
return CMD_RET_FAILURE;
}
puts("Fusing fast boot mode...\n");
diff --git a/board/toradex/apalis_imx6/pf0100.c b/board/toradex/apalis_imx6/pf0100.c
index e066b986fd..52d4952bf3 100644
--- a/board/toradex/apalis_imx6/pf0100.c
+++ b/board/toradex/apalis_imx6/pf0100.c
@@ -38,8 +38,8 @@ unsigned pmic_init(void)
uchar devid, revid, val;
puts("PMIC: ");
- if (!(0 == i2c_set_bus_num(bus) && (0 == i2c_probe(PFUZE100_I2C_ADDR))))
- {
+ if (!((0 == i2c_set_bus_num(bus)) &&
+ (0 == i2c_probe(PFUZE100_I2C_ADDR)))) {
puts("i2c bus failed\n");
return 0;
}
@@ -56,13 +56,13 @@ unsigned pmic_init(void)
#ifdef DEBUG
{
- unsigned i,j;
+ unsigned i, j;
- for (i=0; i<16; i++)
- printf("\t%x",i);
- for (j=0; j<0x80;) {
- printf("\n%2x",j);
- for (i=0; i<16; i++) {
+ for (i = 0; i < 16; i++)
+ printf("\t%x", i);
+ for (j = 0; j < 0x80; ) {
+ printf("\n%2x", j);
+ for (i = 0; i < 16; i++) {
i2c_read(PFUZE100_I2C_ADDR, j+i, 1, &val, 1);
printf("\t%2x", val);
}
@@ -72,14 +72,14 @@ unsigned pmic_init(void)
val = PFUZE100_PAGE_REGISTER_PAGE1;
if (i2c_write(PFUZE100_I2C_ADDR, PFUZE100_PAGE_REGISTER, 1,
- &val, 1)) {
+ &val, 1)) {
puts("i2c write failed\n");
return 0;
}
- for (j=0x80; j<0x100;) {
- printf("\n%2x",j);
- for (i=0; i<16; i++) {
+ for (j = 0x80; j < 0x100; ) {
+ printf("\n%2x", j);
+ for (i = 0; i < 16; i++) {
i2c_read(PFUZE100_I2C_ADDR, j+i, 1, &val, 1);
printf("\t%2x", val);
}
@@ -89,14 +89,14 @@ unsigned pmic_init(void)
val = PFUZE100_PAGE_REGISTER_PAGE2;
if (i2c_write(PFUZE100_I2C_ADDR, PFUZE100_PAGE_REGISTER, 1,
- &val, 1)) {
+ &val, 1)) {
puts("i2c write failed\n");
return 0;
}
- for (j=0x80; j<0x100;) {
- printf("\n%2x",j);
- for (i=0; i<16; i++) {
+ for (j = 0x80; j < 0x100; ) {
+ printf("\n%2x", j);
+ for (i = 0; i < 16; i++) {
i2c_read(PFUZE100_I2C_ADDR, j+i, 1, &val, 1);
printf("\t%2x", val);
}
@@ -107,8 +107,7 @@ unsigned pmic_init(void)
#endif
/* get device programmed state */
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;
}
@@ -150,7 +149,7 @@ unsigned pmic_init(void)
/* set VGEN1 to 1.2V */
val = PFUZE100_VGEN1_VAL;
if (i2c_write(PFUZE100_I2C_ADDR, PFUZE100_VGEN1CTL, 1,
- &val, 1)) {
+ &val, 1)) {
puts("i2c write failed\n");
return programmed;
}
@@ -158,7 +157,7 @@ unsigned pmic_init(void)
/* set SWBST to 5.0V */
val = PFUZE100_SWBST_VAL;
if (i2c_write(PFUZE100_I2C_ADDR, PFUZE100_SWBSTCTL, 1,
- &val, 1)) {
+ &val, 1)) {
puts("i2c write failed\n");
}
}
@@ -177,23 +176,23 @@ int pf0100_prog(void)
}
/* set up gpio to manipulate vprog, initially off */
imx_iomux_v3_setup_multiple_pads(pmic_prog_pads,
- ARRAY_SIZE(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))))
- {
+ if (!((0 == i2c_set_bus_num(bus)) &&
+ (0 == i2c_probe(PFUZE100_I2C_ADDR)))) {
puts("i2c bus failed\n");
return CMD_RET_FAILURE;
}
- for (i=0; i<ARRAY_SIZE(pmic_otp_prog); i++) {
+ for (i = 0; i < ARRAY_SIZE(pmic_otp_prog); i++) {
switch (pmic_otp_prog[i].cmd) {
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, value"
- "0x%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 CMD_RET_FAILURE;
}
break;
@@ -202,7 +201,7 @@ int pf0100_prog(void)
break;
case pmic_vpgm:
gpio_direction_output(PMIC_PROG_VOLTAGE,
- pmic_otp_prog[i].value);
+ pmic_otp_prog[i].value);
break;
case pmic_pwr:
/* TODO */
diff --git a/board/toradex/apalis_imx6/pf0100.h b/board/toradex/apalis_imx6/pf0100.h
index b43744c47e..9096f65ce4 100644
--- a/board/toradex/apalis_imx6/pf0100.h
+++ b/board/toradex/apalis_imx6/pf0100.h
@@ -12,7 +12,7 @@
#define PF0100_H_
/* 7-bit I2C bus slave address */
-#define PFUZE100_I2C_ADDR (0x08)
+#define PFUZE100_I2C_ADDR (0x08)
/* Register Addresses */
#define PFUZE100_DEVICEID (0x0)
#define PFUZE100_REVID (0x3)
@@ -30,7 +30,8 @@
#define PFUZE100_VGEN1CTL (0x6c)
#define PFUZE100_VGEN1_VAL (0x30 + 0x08) /* Always ON, 1.2V */
#define PFUZE100_SWBSTCTL (0x66)
-#define PFUZE100_SWBST_VAL (0x40 + 0x08 + 0x00) /* Always ON, Auto Switching Mode, 5.0V */
+/* Always ON, Auto Switching Mode, 5.0V */
+#define PFUZE100_SWBST_VAL (0x40 + 0x08 + 0x00)
/* chooses the extended page (registers 0x80..0xff) */
#define PFUZE100_PAGE_REGISTER 0x7f
diff --git a/board/toradex/apalis_imx6/pf0100_otp.inc b/board/toradex/apalis_imx6/pf0100_otp.inc
index 680f45c639..4ef62d7eed 100644
--- a/board/toradex/apalis_imx6/pf0100_otp.inc
+++ b/board/toradex/apalis_imx6/pf0100_otp.inc
@@ -7,7 +7,7 @@
// Register Output for PF0100 programmer
// Customer: Toradex AG
// Program: Apalis iMX6
-// Sample marking:
+// Sample marking:
// Date: 12.02.2014
// Time: 17:16:41
// Generated from Spreadsheet Revision: P1.8