am300epd.c (2d8ad8719591fa803b0d589ed057fa46f49b7155) | am300epd.c (5898eb79fb45d4fd4ce22139c168de937bfaab38) |
---|---|
1/* 2 * am300epd.c -- Platform device for AM300 EPD kit 3 * 4 * Copyright (C) 2008, Jaya Kumar 5 * 6 * This file is subject to the terms and conditions of the GNU General Public 7 * License. See the file COPYING in the main directory of this archive for 8 * more details. --- 111 unchanged lines hidden (view full) --- 120 121 /* we also need to take care of the hdb bus */ 122 for (i = DB0_GPIO_PIN; i <= DB15_GPIO_PIN; i++) { 123 sprintf(dbname, "DB%d", i); 124 err = gpio_request(i, dbname); 125 if (err) { 126 dev_err(&am300_device->dev, "failed requesting " 127 "gpio %d, err=%d\n", i, err); | 1/* 2 * am300epd.c -- Platform device for AM300 EPD kit 3 * 4 * Copyright (C) 2008, Jaya Kumar 5 * 6 * This file is subject to the terms and conditions of the GNU General Public 7 * License. See the file COPYING in the main directory of this archive for 8 * more details. --- 111 unchanged lines hidden (view full) --- 120 121 /* we also need to take care of the hdb bus */ 122 for (i = DB0_GPIO_PIN; i <= DB15_GPIO_PIN; i++) { 123 sprintf(dbname, "DB%d", i); 124 err = gpio_request(i, dbname); 125 if (err) { 126 dev_err(&am300_device->dev, "failed requesting " 127 "gpio %d, err=%d\n", i, err); |
128 while (i >= DB0_GPIO_PIN) 129 gpio_free(i--); 130 i = ARRAY_SIZE(gpios) - 1; 131 goto err_req_gpio; | 128 goto err_req_gpio2; |
132 } 133 } 134 135 /* setup the outputs and init values */ 136 gpio_direction_output(PWR_GPIO_PIN, 0); 137 gpio_direction_output(CFG_GPIO_PIN, 1); 138 gpio_direction_output(DC_GPIO_PIN, 0); 139 gpio_direction_output(RD_GPIO_PIN, 1); --- 14 unchanged lines hidden (view full) --- 154 gpio_set_value(RST_GPIO_PIN, 0); 155 msleep(10); 156 gpio_set_value(RST_GPIO_PIN, 1); 157 msleep(10); 158 am300_wait_event(par); 159 160 return 0; 161 | 129 } 130 } 131 132 /* setup the outputs and init values */ 133 gpio_direction_output(PWR_GPIO_PIN, 0); 134 gpio_direction_output(CFG_GPIO_PIN, 1); 135 gpio_direction_output(DC_GPIO_PIN, 0); 136 gpio_direction_output(RD_GPIO_PIN, 1); --- 14 unchanged lines hidden (view full) --- 151 gpio_set_value(RST_GPIO_PIN, 0); 152 msleep(10); 153 gpio_set_value(RST_GPIO_PIN, 1); 154 msleep(10); 155 am300_wait_event(par); 156 157 return 0; 158 |
159err_req_gpio2: 160 while (--i >= DB0_GPIO_PIN) 161 gpio_free(i); 162 i = ARRAY_SIZE(gpios); |
|
162err_req_gpio: | 163err_req_gpio: |
163 while (i > 0) 164 gpio_free(gpios[i--]); | 164 while (--i >= 0) 165 gpio_free(gpios[i]); |
165 166 return err; 167} 168 169static int am300_init_board(struct broadsheetfb_par *par) 170{ 171 return am300_init_gpio_regs(par); 172} --- 123 unchanged lines hidden --- | 166 167 return err; 168} 169 170static int am300_init_board(struct broadsheetfb_par *par) 171{ 172 return am300_init_gpio_regs(par); 173} --- 123 unchanged lines hidden --- |