aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-11-30 08:48:30 -0500
committerArnd Bergmann <arnd@arndb.de>2016-11-30 08:48:30 -0500
commit196249beabe34066fc4655af8bacbb5ab8b77224 (patch)
treea08133fb438b3e1ff647185ab59793b320825c77
parentc0db16b8151eb40d757222a59330c7a9528a9585 (diff)
parentb5e1438cf98a1c588726b0f861178f9aa5a96caf (diff)
Merge tag 'davinci-for-v4.10/soc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/soc
Pull "DaVinci SoC updates for v4.10 (part 3)" from Sekhar Nori: mach-davinci SoC support updates to adjust USB ohci device name to that used by drivers and update of various board files to use gpio descriptor API used by MMC subsystem for card detect and write-protect detection. * tag 'davinci-for-v4.10/soc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: ARM: davinci: da830-evm: use gpio descriptor for mmc pins ARM: davinci: da850-evm: use gpio descriptor for mmc pins ARM: davinci: hawk: use gpio descriptor for mmc pins ARM: davinci: da8xx: Fix ohci device name
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c41
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c35
-rw-r--r--arch/arm/mach-davinci/board-omapl138-hawk.c42
-rw-r--r--arch/arm/mach-davinci/da830.c2
-rw-r--r--arch/arm/mach-davinci/da850.c2
-rw-r--r--arch/arm/mach-davinci/da8xx-dt.c2
-rw-r--r--arch/arm/mach-davinci/usb-da8xx.c4
7 files changed, 37 insertions, 91 deletions
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index 5db09014f55a..58075627c6df 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -14,6 +14,7 @@
14#include <linux/console.h> 14#include <linux/console.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/gpio/machine.h>
17#include <linux/platform_device.h> 18#include <linux/platform_device.h>
18#include <linux/i2c.h> 19#include <linux/i2c.h>
19#include <linux/i2c/pcf857x.h> 20#include <linux/i2c/pcf857x.h>
@@ -204,22 +205,16 @@ static const short da830_evm_mmc_sd_pins[] = {
204 -1 205 -1
205}; 206};
206 207
207#define DA830_MMCSD_WP_PIN GPIO_TO_PIN(2, 1) 208static struct gpiod_lookup_table mmc_gpios_table = {
208#define DA830_MMCSD_CD_PIN GPIO_TO_PIN(2, 2) 209 .dev_id = "da830-mmc.0",
209 210 .table = {
210static int da830_evm_mmc_get_ro(int index) 211 /* gpio chip 1 contains gpio range 32-63 */
211{ 212 GPIO_LOOKUP("davinci_gpio.1", 2, "cd", GPIO_ACTIVE_LOW),
212 return gpio_get_value(DA830_MMCSD_WP_PIN); 213 GPIO_LOOKUP("davinci_gpio.1", 1, "wp", GPIO_ACTIVE_LOW),
213} 214 },
214 215};
215static int da830_evm_mmc_get_cd(int index)
216{
217 return !gpio_get_value(DA830_MMCSD_CD_PIN);
218}
219 216
220static struct davinci_mmc_config da830_evm_mmc_config = { 217static struct davinci_mmc_config da830_evm_mmc_config = {
221 .get_ro = da830_evm_mmc_get_ro,
222 .get_cd = da830_evm_mmc_get_cd,
223 .wires = 8, 218 .wires = 8,
224 .max_freq = 50000000, 219 .max_freq = 50000000,
225 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, 220 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
@@ -235,26 +230,12 @@ static inline void da830_evm_init_mmc(void)
235 return; 230 return;
236 } 231 }
237 232
238 ret = gpio_request(DA830_MMCSD_WP_PIN, "MMC WP"); 233 gpiod_add_lookup_table(&mmc_gpios_table);
239 if (ret) {
240 pr_warn("%s: can not open GPIO %d\n",
241 __func__, DA830_MMCSD_WP_PIN);
242 return;
243 }
244 gpio_direction_input(DA830_MMCSD_WP_PIN);
245
246 ret = gpio_request(DA830_MMCSD_CD_PIN, "MMC CD\n");
247 if (ret) {
248 pr_warn("%s: can not open GPIO %d\n",
249 __func__, DA830_MMCSD_CD_PIN);
250 return;
251 }
252 gpio_direction_input(DA830_MMCSD_CD_PIN);
253 234
254 ret = da8xx_register_mmcsd0(&da830_evm_mmc_config); 235 ret = da8xx_register_mmcsd0(&da830_evm_mmc_config);
255 if (ret) { 236 if (ret) {
256 pr_warn("%s: mmc/sd registration failed: %d\n", __func__, ret); 237 pr_warn("%s: mmc/sd registration failed: %d\n", __func__, ret);
257 gpio_free(DA830_MMCSD_WP_PIN); 238 gpiod_remove_lookup_table(&mmc_gpios_table);
258 } 239 }
259} 240}
260 241
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 265abe7dd77c..aac3ab1a044f 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -15,6 +15,7 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/gpio_keys.h> 17#include <linux/gpio_keys.h>
18#include <linux/gpio/machine.h>
18#include <linux/init.h> 19#include <linux/init.h>
19#include <linux/kernel.h> 20#include <linux/kernel.h>
20#include <linux/i2c.h> 21#include <linux/i2c.h>
@@ -56,9 +57,6 @@
56#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8) 57#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
57#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15) 58#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)
58 59
59#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0)
60#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1)
61
62#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6) 60#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6)
63 61
64static struct mtd_partition da850evm_spiflash_part[] = { 62static struct mtd_partition da850evm_spiflash_part[] = {
@@ -764,19 +762,16 @@ static const short da850_evm_mcasp_pins[] __initconst = {
764 -1 762 -1
765}; 763};
766 764
767static int da850_evm_mmc_get_ro(int index) 765static struct gpiod_lookup_table mmc_gpios_table = {
768{ 766 .dev_id = "da830-mmc.0",
769 return gpio_get_value(DA850_MMCSD_WP_PIN); 767 .table = {
770} 768 /* gpio chip 2 contains gpio range 64-95 */
771 769 GPIO_LOOKUP("davinci_gpio.2", 0, "cd", GPIO_ACTIVE_LOW),
772static int da850_evm_mmc_get_cd(int index) 770 GPIO_LOOKUP("davinci_gpio.2", 1, "wp", GPIO_ACTIVE_LOW),
773{ 771 },
774 return !gpio_get_value(DA850_MMCSD_CD_PIN); 772};
775}
776 773
777static struct davinci_mmc_config da850_mmc_config = { 774static struct davinci_mmc_config da850_mmc_config = {
778 .get_ro = da850_evm_mmc_get_ro,
779 .get_cd = da850_evm_mmc_get_cd,
780 .wires = 4, 775 .wires = 4,
781 .max_freq = 50000000, 776 .max_freq = 50000000,
782 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, 777 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
@@ -1371,17 +1366,7 @@ static __init void da850_evm_init(void)
1371 pr_warn("%s: MMCSD0 mux setup failed: %d\n", 1366 pr_warn("%s: MMCSD0 mux setup failed: %d\n",
1372 __func__, ret); 1367 __func__, ret);
1373 1368
1374 ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n"); 1369 gpiod_add_lookup_table(&mmc_gpios_table);
1375 if (ret)
1376 pr_warn("%s: can not open GPIO %d\n",
1377 __func__, DA850_MMCSD_CD_PIN);
1378 gpio_direction_input(DA850_MMCSD_CD_PIN);
1379
1380 ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n");
1381 if (ret)
1382 pr_warn("%s: can not open GPIO %d\n",
1383 __func__, DA850_MMCSD_WP_PIN);
1384 gpio_direction_input(DA850_MMCSD_WP_PIN);
1385 1370
1386 ret = da8xx_register_mmcsd0(&da850_mmc_config); 1371 ret = da8xx_register_mmcsd0(&da850_mmc_config);
1387 if (ret) 1372 if (ret)
diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c
index a4e87264ebd7..41d5500996b2 100644
--- a/arch/arm/mach-davinci/board-omapl138-hawk.c
+++ b/arch/arm/mach-davinci/board-omapl138-hawk.c
@@ -13,6 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/console.h> 14#include <linux/console.h>
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <linux/gpio/machine.h>
16#include <linux/platform_data/gpio-davinci.h> 17#include <linux/platform_data/gpio-davinci.h>
17#include <linux/regulator/machine.h> 18#include <linux/regulator/machine.h>
18 19
@@ -25,8 +26,6 @@
25#include <mach/mux.h> 26#include <mach/mux.h>
26 27
27#define HAWKBOARD_PHY_ID "davinci_mdio-0:07" 28#define HAWKBOARD_PHY_ID "davinci_mdio-0:07"
28#define DA850_HAWK_MMCSD_CD_PIN GPIO_TO_PIN(3, 12)
29#define DA850_HAWK_MMCSD_WP_PIN GPIO_TO_PIN(3, 13)
30 29
31#define DA850_USB1_VBUS_PIN GPIO_TO_PIN(2, 4) 30#define DA850_USB1_VBUS_PIN GPIO_TO_PIN(2, 4)
32#define DA850_USB1_OC_PIN GPIO_TO_PIN(6, 13) 31#define DA850_USB1_OC_PIN GPIO_TO_PIN(6, 13)
@@ -123,19 +122,16 @@ static const short hawk_mmcsd0_pins[] = {
123 -1 122 -1
124}; 123};
125 124
126static int da850_hawk_mmc_get_ro(int index) 125static struct gpiod_lookup_table mmc_gpios_table = {
127{ 126 .dev_id = "da830-mmc.0",
128 return gpio_get_value(DA850_HAWK_MMCSD_WP_PIN); 127 .table = {
129} 128 /* CD: gpio3_12: gpio60: chip 1 contains gpio range 32-63*/
130 129 GPIO_LOOKUP("davinci_gpio.1", 28, "cd", GPIO_ACTIVE_LOW),
131static int da850_hawk_mmc_get_cd(int index) 130 GPIO_LOOKUP("davinci_gpio.1", 29, "wp", GPIO_ACTIVE_LOW),
132{ 131 },
133 return !gpio_get_value(DA850_HAWK_MMCSD_CD_PIN); 132};
134}
135 133
136static struct davinci_mmc_config da850_mmc_config = { 134static struct davinci_mmc_config da850_mmc_config = {
137 .get_ro = da850_hawk_mmc_get_ro,
138 .get_cd = da850_hawk_mmc_get_cd,
139 .wires = 4, 135 .wires = 4,
140 .max_freq = 50000000, 136 .max_freq = 50000000,
141 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, 137 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
@@ -151,21 +147,7 @@ static __init void omapl138_hawk_mmc_init(void)
151 return; 147 return;
152 } 148 }
153 149
154 ret = gpio_request_one(DA850_HAWK_MMCSD_CD_PIN, 150 gpiod_add_lookup_table(&mmc_gpios_table);
155 GPIOF_DIR_IN, "MMC CD");
156 if (ret < 0) {
157 pr_warn("%s: can not open GPIO %d\n",
158 __func__, DA850_HAWK_MMCSD_CD_PIN);
159 return;
160 }
161
162 ret = gpio_request_one(DA850_HAWK_MMCSD_WP_PIN,
163 GPIOF_DIR_IN, "MMC WP");
164 if (ret < 0) {
165 pr_warn("%s: can not open GPIO %d\n",
166 __func__, DA850_HAWK_MMCSD_WP_PIN);
167 goto mmc_setup_wp_fail;
168 }
169 151
170 ret = da8xx_register_mmcsd0(&da850_mmc_config); 152 ret = da8xx_register_mmcsd0(&da850_mmc_config);
171 if (ret) { 153 if (ret) {
@@ -176,9 +158,7 @@ static __init void omapl138_hawk_mmc_init(void)
176 return; 158 return;
177 159
178mmc_setup_mmcsd_fail: 160mmc_setup_mmcsd_fail:
179 gpio_free(DA850_HAWK_MMCSD_WP_PIN); 161 gpiod_remove_lookup_table(&mmc_gpios_table);
180mmc_setup_wp_fail:
181 gpio_free(DA850_HAWK_MMCSD_CD_PIN);
182} 162}
183 163
184static irqreturn_t omapl138_hawk_usb_ocic_irq(int irq, void *dev_id); 164static irqreturn_t omapl138_hawk_usb_ocic_irq(int irq, void *dev_id);
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index 41459bd91c85..073c458d0c67 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -420,7 +420,7 @@ static struct clk_lookup da830_clks[] = {
420 CLK("davinci_mdio.0", "fck", &emac_clk), 420 CLK("davinci_mdio.0", "fck", &emac_clk),
421 CLK(NULL, "gpio", &gpio_clk), 421 CLK(NULL, "gpio", &gpio_clk),
422 CLK("i2c_davinci.2", NULL, &i2c1_clk), 422 CLK("i2c_davinci.2", NULL, &i2c1_clk),
423 CLK("ohci", "usb11", &usb11_clk), 423 CLK("ohci-da8xx", "usb11", &usb11_clk),
424 CLK(NULL, "emif3", &emif3_clk), 424 CLK(NULL, "emif3", &emif3_clk),
425 CLK(NULL, "arm", &arm_clk), 425 CLK(NULL, "arm", &arm_clk),
426 CLK(NULL, "rmii", &rmii_clk), 426 CLK(NULL, "rmii", &rmii_clk),
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 512ccc19e4e1..9b00d9119467 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -503,7 +503,7 @@ static struct clk_lookup da850_clks[] = {
503 CLK("da830-mmc.1", NULL, &mmcsd1_clk), 503 CLK("da830-mmc.1", NULL, &mmcsd1_clk),
504 CLK("ti-aemif", NULL, &aemif_clk), 504 CLK("ti-aemif", NULL, &aemif_clk),
505 CLK(NULL, "aemif", &aemif_clk), 505 CLK(NULL, "aemif", &aemif_clk),
506 CLK("ohci", "usb11", &usb11_clk), 506 CLK("ohci-da8xx", "usb11", &usb11_clk),
507 CLK("musb-da8xx", "usb20", &usb20_clk), 507 CLK("musb-da8xx", "usb20", &usb20_clk),
508 CLK("spi_davinci.0", NULL, &spi0_clk), 508 CLK("spi_davinci.0", NULL, &spi0_clk),
509 CLK("spi_davinci.1", NULL, &spi1_clk), 509 CLK("spi_davinci.1", NULL, &spi1_clk),
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index e87ff2b66f12..3b169e4e6e2e 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -39,7 +39,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
39 OF_DEV_AUXDATA("ti,da830-mcasp-audio", 0x01d00000, "davinci-mcasp.0", NULL), 39 OF_DEV_AUXDATA("ti,da830-mcasp-audio", 0x01d00000, "davinci-mcasp.0", NULL),
40 OF_DEV_AUXDATA("ti,da850-aemif", 0x68000000, "ti-aemif", NULL), 40 OF_DEV_AUXDATA("ti,da850-aemif", 0x68000000, "ti-aemif", NULL),
41 OF_DEV_AUXDATA("ti,da850-tilcdc", 0x01e13000, "da8xx_lcdc.0", NULL), 41 OF_DEV_AUXDATA("ti,da850-tilcdc", 0x01e13000, "da8xx_lcdc.0", NULL),
42 OF_DEV_AUXDATA("ti,da830-ohci", 0x01e25000, "ohci", NULL), 42 OF_DEV_AUXDATA("ti,da830-ohci", 0x01e25000, "ohci-da8xx", NULL),
43 OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL), 43 OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL),
44 OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy", NULL), 44 OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy", NULL),
45 {} 45 {}
diff --git a/arch/arm/mach-davinci/usb-da8xx.c b/arch/arm/mach-davinci/usb-da8xx.c
index b010e5f80c5f..c6feecf7ae24 100644
--- a/arch/arm/mach-davinci/usb-da8xx.c
+++ b/arch/arm/mach-davinci/usb-da8xx.c
@@ -109,8 +109,8 @@ static struct resource da8xx_usb11_resources[] = {
109static u64 da8xx_usb11_dma_mask = DMA_BIT_MASK(32); 109static u64 da8xx_usb11_dma_mask = DMA_BIT_MASK(32);
110 110
111static struct platform_device da8xx_usb11_device = { 111static struct platform_device da8xx_usb11_device = {
112 .name = "ohci", 112 .name = "ohci-da8xx",
113 .id = 0, 113 .id = -1,
114 .dev = { 114 .dev = {
115 .dma_mask = &da8xx_usb11_dma_mask, 115 .dma_mask = &da8xx_usb11_dma_mask,
116 .coherent_dma_mask = DMA_BIT_MASK(32), 116 .coherent_dma_mask = DMA_BIT_MASK(32),