aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf548
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2013-05-30 06:37:28 -0400
committerSteven Miao <realmz6@gmail.com>2013-11-15 04:33:42 -0500
commit54e4ff4d402450af5cec599f1cd9ab34997b3149 (patch)
tree2b4c53899c774b45fa37dbfc0440e459b2fdc16b /arch/blackfin/mach-bf548
parent036c5df1839f709ed2018d4cd3bed1934eb26b83 (diff)
blackfin: adi gpio driver and pinctrl driver support
Remove gpio driver for new gpio controller on BF54x and BF60x. Build the bfin_gpio driver only when other BF5xx processors are selected. Replace the prefix of some gpio and peripheral functions with adi. add portmux platform data in machine portmux.h Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Steven Miao <realmz6@gmail.com>
Diffstat (limited to 'arch/blackfin/mach-bf548')
-rw-r--r--arch/blackfin/mach-bf548/Kconfig34
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c495
-rw-r--r--arch/blackfin/mach-bf548/include/mach/gpio.h8
-rw-r--r--arch/blackfin/mach-bf548/include/mach/irq.h2
-rw-r--r--arch/blackfin/mach-bf548/include/mach/portmux.h2
5 files changed, 489 insertions, 52 deletions
diff --git a/arch/blackfin/mach-bf548/Kconfig b/arch/blackfin/mach-bf548/Kconfig
index 94acb586832e..334ec7b12188 100644
--- a/arch/blackfin/mach-bf548/Kconfig
+++ b/arch/blackfin/mach-bf548/Kconfig
@@ -377,40 +377,6 @@ config IRQ_PINT3
377 377
378endmenu 378endmenu
379 379
380comment "Pin Interrupt to Port Assignment"
381menu "Assignment"
382
383config PINTx_REASSIGN
384 bool "Reprogram PINT Assignment"
385 default y
386 help
387 The interrupt assignment registers controls the pin-to-interrupt
388 assignment in a byte-wide manner. Each option allows you to select
389 a set of pins (High/Low Byte) of an specific Port being mapped
390 to one of the four PIN Interrupts IRQ_PINTx.
391
392 You shouldn't change any of these unless you know exactly what you're doing.
393 Please consult the Blackfin BF54x Processor Hardware Reference Manual.
394
395config PINT0_ASSIGN
396 hex "PINT0_ASSIGN"
397 depends on PINTx_REASSIGN
398 default 0x00000101
399config PINT1_ASSIGN
400 hex "PINT1_ASSIGN"
401 depends on PINTx_REASSIGN
402 default 0x01010000
403config PINT2_ASSIGN
404 hex "PINT2_ASSIGN"
405 depends on PINTx_REASSIGN
406 default 0x07000101
407config PINT3_ASSIGN
408 hex "PINT3_ASSIGN"
409 depends on PINTx_REASSIGN
410 default 0x02020303
411
412endmenu
413
414endmenu 380endmenu
415 381
416endif 382endif
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 372eb54944ef..984b3f9984cd 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -17,6 +17,9 @@
17#include <linux/i2c.h> 17#include <linux/i2c.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/usb/musb.h> 19#include <linux/usb/musb.h>
20#include <linux/pinctrl/machine.h>
21#include <linux/pinctrl/pinconf-generic.h>
22#include <linux/platform_data/pinctrl-adi2.h>
20#include <asm/bfin5xx_spi.h> 23#include <asm/bfin5xx_spi.h>
21#include <asm/dma.h> 24#include <asm/dma.h>
22#include <asm/gpio.h> 25#include <asm/gpio.h>
@@ -1058,6 +1061,411 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
1058}; 1061};
1059#endif 1062#endif
1060 1063
1064#ifdef CONFIG_PINCTRL_ADI2
1065
1066# define ADI_PINT_DEVNAME "adi-gpio-pint"
1067# define ADI_GPIO_DEVNAME "adi-gpio"
1068# define ADI_PINCTRL_DEVNAME "pinctrl-adi2"
1069
1070static struct platform_device bfin_pinctrl_device = {
1071 .name = ADI_PINCTRL_DEVNAME,
1072 .id = 0,
1073};
1074
1075static struct resource bfin_pint0_resources[] = {
1076 {
1077 .start = PINT0_MASK_SET,
1078 .end = PINT0_LATCH + 3,
1079 .flags = IORESOURCE_MEM,
1080 },
1081 {
1082 .start = IRQ_PINT0,
1083 .end = IRQ_PINT0,
1084 .flags = IORESOURCE_IRQ,
1085 },
1086};
1087
1088static struct platform_device bfin_pint0_device = {
1089 .name = ADI_PINT_DEVNAME,
1090 .id = 0,
1091 .num_resources = ARRAY_SIZE(bfin_pint0_resources),
1092 .resource = bfin_pint0_resources,
1093};
1094
1095static struct resource bfin_pint1_resources[] = {
1096 {
1097 .start = PINT1_MASK_SET,
1098 .end = PINT1_LATCH + 3,
1099 .flags = IORESOURCE_MEM,
1100 },
1101 {
1102 .start = IRQ_PINT1,
1103 .end = IRQ_PINT1,
1104 .flags = IORESOURCE_IRQ,
1105 },
1106};
1107
1108static struct platform_device bfin_pint1_device = {
1109 .name = ADI_PINT_DEVNAME,
1110 .id = 1,
1111 .num_resources = ARRAY_SIZE(bfin_pint1_resources),
1112 .resource = bfin_pint1_resources,
1113};
1114
1115static struct resource bfin_pint2_resources[] = {
1116 {
1117 .start = PINT2_MASK_SET,
1118 .end = PINT2_LATCH + 3,
1119 .flags = IORESOURCE_MEM,
1120 },
1121 {
1122 .start = IRQ_PINT2,
1123 .end = IRQ_PINT2,
1124 .flags = IORESOURCE_IRQ,
1125 },
1126};
1127
1128static struct platform_device bfin_pint2_device = {
1129 .name = ADI_PINT_DEVNAME,
1130 .id = 2,
1131 .num_resources = ARRAY_SIZE(bfin_pint2_resources),
1132 .resource = bfin_pint2_resources,
1133};
1134
1135static struct resource bfin_pint3_resources[] = {
1136 {
1137 .start = PINT3_MASK_SET,
1138 .end = PINT3_LATCH + 3,
1139 .flags = IORESOURCE_MEM,
1140 },
1141 {
1142 .start = IRQ_PINT3,
1143 .end = IRQ_PINT3,
1144 .flags = IORESOURCE_IRQ,
1145 },
1146};
1147
1148static struct platform_device bfin_pint3_device = {
1149 .name = ADI_PINT_DEVNAME,
1150 .id = 3,
1151 .num_resources = ARRAY_SIZE(bfin_pint3_resources),
1152 .resource = bfin_pint3_resources,
1153};
1154
1155static struct resource bfin_gpa_resources[] = {
1156 {
1157 .start = PORTA_FER,
1158 .end = PORTA_MUX + 3,
1159 .flags = IORESOURCE_MEM,
1160 },
1161 { /* optional */
1162 .start = IRQ_PA0,
1163 .end = IRQ_PA0,
1164 .flags = IORESOURCE_IRQ,
1165 },
1166};
1167
1168static struct adi_pinctrl_gpio_platform_data bfin_gpa_pdata = {
1169 .port_gpio_base = GPIO_PA0, /* Optional */
1170 .port_pin_base = GPIO_PA0,
1171 .port_width = GPIO_BANKSIZE,
1172 .pint_id = 0, /* PINT0 */
1173 .pint_assign = true, /* PINT upper 16 bit */
1174 .pint_map = 0, /* mapping mask in PINT */
1175};
1176
1177static struct platform_device bfin_gpa_device = {
1178 .name = ADI_GPIO_DEVNAME,
1179 .id = 0,
1180 .num_resources = ARRAY_SIZE(bfin_gpa_resources),
1181 .resource = bfin_gpa_resources,
1182 .dev = {
1183 .platform_data = &bfin_gpa_pdata, /* Passed to driver */
1184 },
1185};
1186
1187static struct resource bfin_gpb_resources[] = {
1188 {
1189 .start = PORTB_FER,
1190 .end = PORTB_MUX + 3,
1191 .flags = IORESOURCE_MEM,
1192 },
1193 {
1194 .start = IRQ_PB0,
1195 .end = IRQ_PB0,
1196 .flags = IORESOURCE_IRQ,
1197 },
1198};
1199
1200static struct adi_pinctrl_gpio_platform_data bfin_gpb_pdata = {
1201 .port_gpio_base = GPIO_PB0,
1202 .port_pin_base = GPIO_PB0,
1203 .port_width = 15,
1204 .pint_id = 0,
1205 .pint_assign = true,
1206 .pint_map = 1,
1207};
1208
1209static struct platform_device bfin_gpb_device = {
1210 .name = ADI_GPIO_DEVNAME,
1211 .id = 1,
1212 .num_resources = ARRAY_SIZE(bfin_gpb_resources),
1213 .resource = bfin_gpb_resources,
1214 .dev = {
1215 .platform_data = &bfin_gpb_pdata, /* Passed to driver */
1216 },
1217};
1218
1219static struct resource bfin_gpc_resources[] = {
1220 {
1221 .start = PORTC_FER,
1222 .end = PORTC_MUX + 3,
1223 .flags = IORESOURCE_MEM,
1224 },
1225 {
1226 .start = IRQ_PC0,
1227 .end = IRQ_PC0,
1228 .flags = IORESOURCE_IRQ,
1229 },
1230};
1231
1232static struct adi_pinctrl_gpio_platform_data bfin_gpc_pdata = {
1233 .port_gpio_base = GPIO_PC0,
1234 .port_pin_base = GPIO_PC0,
1235 .port_width = 14,
1236 .pint_id = 2,
1237 .pint_assign = true,
1238 .pint_map = 0,
1239};
1240
1241static struct platform_device bfin_gpc_device = {
1242 .name = ADI_GPIO_DEVNAME,
1243 .id = 2,
1244 .num_resources = ARRAY_SIZE(bfin_gpc_resources),
1245 .resource = bfin_gpc_resources,
1246 .dev = {
1247 .platform_data = &bfin_gpc_pdata, /* Passed to driver */
1248 },
1249};
1250
1251static struct resource bfin_gpd_resources[] = {
1252 {
1253 .start = PORTD_FER,
1254 .end = PORTD_MUX + 3,
1255 .flags = IORESOURCE_MEM,
1256 },
1257 {
1258 .start = IRQ_PD0,
1259 .end = IRQ_PD0,
1260 .flags = IORESOURCE_IRQ,
1261 },
1262};
1263
1264static struct adi_pinctrl_gpio_platform_data bfin_gpd_pdata = {
1265 .port_gpio_base = GPIO_PD0,
1266 .port_pin_base = GPIO_PD0,
1267 .port_width = GPIO_BANKSIZE,
1268 .pint_id = 2,
1269 .pint_assign = false,
1270 .pint_map = 1,
1271};
1272
1273static struct platform_device bfin_gpd_device = {
1274 .name = ADI_GPIO_DEVNAME,
1275 .id = 3,
1276 .num_resources = ARRAY_SIZE(bfin_gpd_resources),
1277 .resource = bfin_gpd_resources,
1278 .dev = {
1279 .platform_data = &bfin_gpd_pdata, /* Passed to driver */
1280 },
1281};
1282
1283static struct resource bfin_gpe_resources[] = {
1284 {
1285 .start = PORTE_FER,
1286 .end = PORTE_MUX + 3,
1287 .flags = IORESOURCE_MEM,
1288 },
1289 {
1290 .start = IRQ_PE0,
1291 .end = IRQ_PE0,
1292 .flags = IORESOURCE_IRQ,
1293 },
1294};
1295
1296static struct adi_pinctrl_gpio_platform_data bfin_gpe_pdata = {
1297 .port_gpio_base = GPIO_PE0,
1298 .port_pin_base = GPIO_PE0,
1299 .port_width = GPIO_BANKSIZE,
1300 .pint_id = 3,
1301 .pint_assign = true,
1302 .pint_map = 2,
1303};
1304
1305static struct platform_device bfin_gpe_device = {
1306 .name = ADI_GPIO_DEVNAME,
1307 .id = 4,
1308 .num_resources = ARRAY_SIZE(bfin_gpe_resources),
1309 .resource = bfin_gpe_resources,
1310 .dev = {
1311 .platform_data = &bfin_gpe_pdata, /* Passed to driver */
1312 },
1313};
1314
1315static struct resource bfin_gpf_resources[] = {
1316 {
1317 .start = PORTF_FER,
1318 .end = PORTF_MUX + 3,
1319 .flags = IORESOURCE_MEM,
1320 },
1321 {
1322 .start = IRQ_PF0,
1323 .end = IRQ_PF0,
1324 .flags = IORESOURCE_IRQ,
1325 },
1326};
1327
1328static struct adi_pinctrl_gpio_platform_data bfin_gpf_pdata = {
1329 .port_gpio_base = GPIO_PF0,
1330 .port_pin_base = GPIO_PF0,
1331 .port_width = GPIO_BANKSIZE,
1332 .pint_id = 3,
1333 .pint_assign = false,
1334 .pint_map = 3,
1335};
1336
1337static struct platform_device bfin_gpf_device = {
1338 .name = ADI_GPIO_DEVNAME,
1339 .id = 5,
1340 .num_resources = ARRAY_SIZE(bfin_gpf_resources),
1341 .resource = bfin_gpf_resources,
1342 .dev = {
1343 .platform_data = &bfin_gpf_pdata, /* Passed to driver */
1344 },
1345};
1346
1347static struct resource bfin_gpg_resources[] = {
1348 {
1349 .start = PORTG_FER,
1350 .end = PORTG_MUX + 3,
1351 .flags = IORESOURCE_MEM,
1352 },
1353 {
1354 .start = IRQ_PG0,
1355 .end = IRQ_PG0,
1356 .flags = IORESOURCE_IRQ,
1357 },
1358};
1359
1360static struct adi_pinctrl_gpio_platform_data bfin_gpg_pdata = {
1361 .port_gpio_base = GPIO_PG0,
1362 .port_pin_base = GPIO_PG0,
1363 .port_width = GPIO_BANKSIZE,
1364 .pint_id = -1,
1365};
1366
1367static struct platform_device bfin_gpg_device = {
1368 .name = ADI_GPIO_DEVNAME,
1369 .id = 6,
1370 .num_resources = ARRAY_SIZE(bfin_gpg_resources),
1371 .resource = bfin_gpg_resources,
1372 .dev = {
1373 .platform_data = &bfin_gpg_pdata, /* Passed to driver */
1374 },
1375};
1376
1377static struct resource bfin_gph_resources[] = {
1378 {
1379 .start = PORTH_FER,
1380 .end = PORTH_MUX + 3,
1381 .flags = IORESOURCE_MEM,
1382 },
1383 {
1384 .start = IRQ_PH0,
1385 .end = IRQ_PH0,
1386 .flags = IORESOURCE_IRQ,
1387 },
1388};
1389
1390static struct adi_pinctrl_gpio_platform_data bfin_gph_pdata = {
1391 .port_gpio_base = GPIO_PH0,
1392 .port_pin_base = GPIO_PH0,
1393 .port_width = 14,
1394 .pint_id = -1,
1395};
1396
1397static struct platform_device bfin_gph_device = {
1398 .name = ADI_GPIO_DEVNAME,
1399 .id = 7,
1400 .num_resources = ARRAY_SIZE(bfin_gph_resources),
1401 .resource = bfin_gph_resources,
1402 .dev = {
1403 .platform_data = &bfin_gph_pdata, /* Passed to driver */
1404 },
1405};
1406
1407static struct resource bfin_gpi_resources[] = {
1408 {
1409 .start = PORTI_FER,
1410 .end = PORTI_MUX + 3,
1411 .flags = IORESOURCE_MEM,
1412 },
1413 {
1414 .start = IRQ_PI0,
1415 .end = IRQ_PI0,
1416 .flags = IORESOURCE_IRQ,
1417 },
1418};
1419
1420static struct adi_pinctrl_gpio_platform_data bfin_gpi_pdata = {
1421 .port_gpio_base = GPIO_PI0,
1422 .port_pin_base = GPIO_PI0,
1423 .port_width = GPIO_BANKSIZE,
1424 .pint_id = -1,
1425};
1426
1427static struct platform_device bfin_gpi_device = {
1428 .name = ADI_GPIO_DEVNAME,
1429 .id = 8,
1430 .num_resources = ARRAY_SIZE(bfin_gpi_resources),
1431 .resource = bfin_gpi_resources,
1432 .dev = {
1433 .platform_data = &bfin_gpi_pdata, /* Passed to driver */
1434 },
1435};
1436
1437static struct resource bfin_gpj_resources[] = {
1438 {
1439 .start = PORTJ_FER,
1440 .end = PORTJ_MUX + 3,
1441 .flags = IORESOURCE_MEM,
1442 },
1443 {
1444 .start = IRQ_PJ0,
1445 .end = IRQ_PJ0,
1446 .flags = IORESOURCE_IRQ,
1447 },
1448};
1449
1450static struct adi_pinctrl_gpio_platform_data bfin_gpj_pdata = {
1451 .port_gpio_base = GPIO_PJ0,
1452 .port_pin_base = GPIO_PJ0,
1453 .port_width = 14,
1454 .pint_id = -1,
1455};
1456
1457static struct platform_device bfin_gpj_device = {
1458 .name = ADI_GPIO_DEVNAME,
1459 .id = 9,
1460 .num_resources = ARRAY_SIZE(bfin_gpj_resources),
1461 .resource = bfin_gpj_resources,
1462 .dev = {
1463 .platform_data = &bfin_gpj_pdata, /* Passed to driver */
1464 },
1465};
1466
1467#endif
1468
1061static struct spi_board_info bfin_spi_board_info[] __initdata = { 1469static struct spi_board_info bfin_spi_board_info[] __initdata = {
1062#if defined(CONFIG_MTD_M25P80) \ 1470#if defined(CONFIG_MTD_M25P80) \
1063 || defined(CONFIG_MTD_M25P80_MODULE) 1471 || defined(CONFIG_MTD_M25P80_MODULE)
@@ -1066,7 +1474,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1066 .modalias = "m25p80", /* Name of spi_driver for this device */ 1474 .modalias = "m25p80", /* Name of spi_driver for this device */
1067 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 1475 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
1068 .bus_num = 0, /* Framework bus number */ 1476 .bus_num = 0, /* Framework bus number */
1069 .chip_select = 1, /* SPI_SSEL1*/ 1477 .chip_select = MAX_CTRL_CS + GPIO_PE4, /* SPI_SSEL1*/
1070 .platform_data = &bfin_spi_flash_data, 1478 .platform_data = &bfin_spi_flash_data,
1071 .controller_data = &spi_flash_chip_info, 1479 .controller_data = &spi_flash_chip_info,
1072 .mode = SPI_MODE_3, 1480 .mode = SPI_MODE_3,
@@ -1078,7 +1486,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1078 .modalias = "ad183x", 1486 .modalias = "ad183x",
1079 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 1487 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1080 .bus_num = 1, 1488 .bus_num = 1,
1081 .chip_select = 4, 1489 .chip_select = MAX_CTRL_CS + GPIO_PG6, /* SPI_SSEL2 */
1082 }, 1490 },
1083#endif 1491#endif
1084#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 1492#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
@@ -1088,7 +1496,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1088 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */ 1496 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
1089 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 1497 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
1090 .bus_num = 0, 1498 .bus_num = 0,
1091 .chip_select = 2, 1499 .chip_select = MAX_CTRL_CS + GPIO_PE5, /* SPI_SSEL2 */
1092 }, 1500 },
1093#endif 1501#endif
1094#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 1502#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
@@ -1096,7 +1504,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1096 .modalias = "spidev", 1504 .modalias = "spidev",
1097 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 1505 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1098 .bus_num = 0, 1506 .bus_num = 0,
1099 .chip_select = 1, 1507 .chip_select = MAX_CTRL_CS + GPIO_PE4, /* SPI_SSEL1 */
1100 }, 1508 },
1101#endif 1509#endif
1102#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE) 1510#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
@@ -1106,7 +1514,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1106 .irq = IRQ_PC5, 1514 .irq = IRQ_PC5,
1107 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ 1515 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1108 .bus_num = 1, 1516 .bus_num = 1,
1109 .chip_select = 2, 1517 .chip_select = MAX_CTRL_CS + GPIO_PG6, /* SPI_SSEL2 */
1110 .mode = SPI_MODE_3, 1518 .mode = SPI_MODE_3,
1111 }, 1519 },
1112#endif 1520#endif
@@ -1152,7 +1560,7 @@ static struct resource bfin_spi1_resource[] = {
1152 1560
1153/* SPI controller data */ 1561/* SPI controller data */
1154static struct bfin5xx_spi_master bf54x_spi_master_info0 = { 1562static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
1155 .num_chipselect = 4, 1563 .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
1156 .enable_dma = 1, /* master has the ability to do dma transfer */ 1564 .enable_dma = 1, /* master has the ability to do dma transfer */
1157 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, 1565 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
1158}; 1566};
@@ -1168,7 +1576,7 @@ static struct platform_device bf54x_spi_master0 = {
1168}; 1576};
1169 1577
1170static struct bfin5xx_spi_master bf54x_spi_master_info1 = { 1578static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
1171 .num_chipselect = 4, 1579 .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
1172 .enable_dma = 1, /* master has the ability to do dma transfer */ 1580 .enable_dma = 1, /* master has the ability to do dma transfer */
1173 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0}, 1581 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
1174}; 1582};
@@ -1508,6 +1916,23 @@ static struct platform_device bfin_ac97 = {
1508static struct platform_device *ezkit_devices[] __initdata = { 1916static struct platform_device *ezkit_devices[] __initdata = {
1509 1917
1510 &bfin_dpmc, 1918 &bfin_dpmc,
1919#if defined(CONFIG_PINCTRL_ADI2)
1920 &bfin_pinctrl_device,
1921 &bfin_pint0_device,
1922 &bfin_pint1_device,
1923 &bfin_pint2_device,
1924 &bfin_pint3_device,
1925 &bfin_gpa_device,
1926 &bfin_gpb_device,
1927 &bfin_gpc_device,
1928 &bfin_gpd_device,
1929 &bfin_gpe_device,
1930 &bfin_gpf_device,
1931 &bfin_gpg_device,
1932 &bfin_gph_device,
1933 &bfin_gpi_device,
1934 &bfin_gpj_device,
1935#endif
1511 1936
1512#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 1937#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1513 &rtc_device, 1938 &rtc_device,
@@ -1644,10 +2069,66 @@ static struct platform_device *ezkit_devices[] __initdata = {
1644#endif 2069#endif
1645}; 2070};
1646 2071
2072/* Pin control settings */
2073static struct pinctrl_map __initdata bfin_pinmux_map[] = {
2074 /* per-device maps */
2075 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.0", "pinctrl-adi2.0", NULL, "uart0"),
2076 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.1", "pinctrl-adi2.0", NULL, "uart1"),
2077#ifdef CONFIG_BFIN_UART1_CTSRTS
2078 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.1", "pinctrl-adi2.0", NULL, "uart1_ctsrts"),
2079#endif
2080 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.2", "pinctrl-adi2.0", NULL, "uart2"),
2081 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.3", "pinctrl-adi2.0", NULL, "uart3"),
2082#ifdef CONFIG_BFIN_UART3_CTSRTS
2083 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.3", "pinctrl-adi2.0", NULL, "uart3_ctsrts"),
2084#endif
2085 PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.0", "pinctrl-adi2.0", NULL, "uart0"),
2086 PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.1", "pinctrl-adi2.0", NULL, "uart1"),
2087 PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.2", "pinctrl-adi2.0", NULL, "uart2"),
2088 PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.3", "pinctrl-adi2.0", NULL, "uart3"),
2089 PIN_MAP_MUX_GROUP_DEFAULT("bfin-sdh.0", "pinctrl-adi2.0", NULL, "rsi0"),
2090 PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi.0", "pinctrl-adi2.0", NULL, "spi0"),
2091 PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi.1", "pinctrl-adi2.0", NULL, "spi1"),
2092 PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.0", "pinctrl-adi2.0", NULL, "twi0"),
2093#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
2094 PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.1", "pinctrl-adi2.0", NULL, "twi1"),
2095#endif
2096 PIN_MAP_MUX_GROUP_DEFAULT("bfin-rotary", "pinctrl-adi2.0", NULL, "rotary"),
2097 PIN_MAP_MUX_GROUP_DEFAULT("bfin_can.0", "pinctrl-adi2.0", NULL, "can0"),
2098 PIN_MAP_MUX_GROUP_DEFAULT("bfin_can.1", "pinctrl-adi2.0", NULL, "can1"),
2099 PIN_MAP_MUX_GROUP_DEFAULT("bf54x-lq043", "pinctrl-adi2.0", NULL, "ppi0_24b"),
2100 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.0", "pinctrl-adi2.0", NULL, "sport0"),
2101 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.0", "pinctrl-adi2.0", NULL, "sport0"),
2102 PIN_MAP_MUX_GROUP_DEFAULT("bfin-ac97.0", "pinctrl-adi2.0", NULL, "sport0"),
2103 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.1", "pinctrl-adi2.0", NULL, "sport1"),
2104 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.1", "pinctrl-adi2.0", NULL, "sport1"),
2105 PIN_MAP_MUX_GROUP_DEFAULT("bfin-ac97.1", "pinctrl-adi2.0", NULL, "sport1"),
2106 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.2", "pinctrl-adi2.0", NULL, "sport2"),
2107 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.2", "pinctrl-adi2.0", NULL, "sport2"),
2108 PIN_MAP_MUX_GROUP_DEFAULT("bfin-ac97.2", "pinctrl-adi2.0", NULL, "sport2"),
2109 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.3", "pinctrl-adi2.0", NULL, "sport3"),
2110 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.3", "pinctrl-adi2.0", NULL, "sport3"),
2111 PIN_MAP_MUX_GROUP_DEFAULT("bfin-ac97.3", "pinctrl-adi2.0", NULL, "sport3"),
2112 PIN_MAP_MUX_GROUP_DEFAULT("bfin-sport-uart.0", "pinctrl-adi2.0", NULL, "sport0"),
2113 PIN_MAP_MUX_GROUP_DEFAULT("bfin-sport-uart.1", "pinctrl-adi2.0", NULL, "sport1"),
2114 PIN_MAP_MUX_GROUP_DEFAULT("bfin-sport-uart.2", "pinctrl-adi2.0", NULL, "sport2"),
2115 PIN_MAP_MUX_GROUP_DEFAULT("bfin-sport-uart.3", "pinctrl-adi2.0", NULL, "sport3"),
2116 PIN_MAP_MUX_GROUP_DEFAULT("pata-bf54x", "pinctrl-adi2.0", NULL, "atapi"),
2117#ifdef CONFIG_BF548_ATAPI_ALTERNATIVE_PORT
2118 PIN_MAP_MUX_GROUP_DEFAULT("pata-bf54x", "pinctrl-adi2.0", NULL, "atapi_alter"),
2119#endif
2120 PIN_MAP_MUX_GROUP_DEFAULT("bf5xx-nand.0", "pinctrl-adi2.0", NULL, "nfc0"),
2121 PIN_MAP_MUX_GROUP_DEFAULT("bf54x-keys", "pinctrl-adi2.0", NULL, "keys_4x4"),
2122};
2123
1647static int __init ezkit_init(void) 2124static int __init ezkit_init(void)
1648{ 2125{
1649 printk(KERN_INFO "%s(): registering device resources\n", __func__); 2126 printk(KERN_INFO "%s(): registering device resources\n", __func__);
1650 2127
2128 /* Initialize pinmuxing */
2129 pinctrl_register_mappings(bfin_pinmux_map,
2130 ARRAY_SIZE(bfin_pinmux_map));
2131
1651 i2c_register_board_info(0, bfin_i2c_board_info0, 2132 i2c_register_board_info(0, bfin_i2c_board_info0,
1652 ARRAY_SIZE(bfin_i2c_board_info0)); 2133 ARRAY_SIZE(bfin_i2c_board_info0));
1653#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ 2134#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
diff --git a/arch/blackfin/mach-bf548/include/mach/gpio.h b/arch/blackfin/mach-bf548/include/mach/gpio.h
index be9edb28f96b..006da1edcf84 100644
--- a/arch/blackfin/mach-bf548/include/mach/gpio.h
+++ b/arch/blackfin/mach-bf548/include/mach/gpio.h
@@ -194,14 +194,6 @@ struct gpio_port_t {
194 unsigned int port_mux; 194 unsigned int port_mux;
195}; 195};
196 196
197struct gpio_port_s {
198 unsigned short fer;
199 unsigned short data;
200 unsigned short dir;
201 unsigned short inen;
202 unsigned int mux;
203};
204
205#endif 197#endif
206 198
207#include <mach-common/ports-a.h> 199#include <mach-common/ports-a.h>
diff --git a/arch/blackfin/mach-bf548/include/mach/irq.h b/arch/blackfin/mach-bf548/include/mach/irq.h
index 10dc142c518d..cf7cb725cfa2 100644
--- a/arch/blackfin/mach-bf548/include/mach/irq.h
+++ b/arch/blackfin/mach-bf548/include/mach/irq.h
@@ -433,7 +433,7 @@
433#include <linux/types.h> 433#include <linux/types.h>
434 434
435/* 435/*
436 * bfin pint registers layout 436 * gpio pint registers layout
437 */ 437 */
438struct bfin_pint_regs { 438struct bfin_pint_regs {
439 u32 mask_set; 439 u32 mask_set;
diff --git a/arch/blackfin/mach-bf548/include/mach/portmux.h b/arch/blackfin/mach-bf548/include/mach/portmux.h
index e22246202730..d9f8632d7d09 100644
--- a/arch/blackfin/mach-bf548/include/mach/portmux.h
+++ b/arch/blackfin/mach-bf548/include/mach/portmux.h
@@ -7,8 +7,6 @@
7#ifndef _MACH_PORTMUX_H_ 7#ifndef _MACH_PORTMUX_H_
8#define _MACH_PORTMUX_H_ 8#define _MACH_PORTMUX_H_
9 9
10#define MAX_RESOURCES MAX_BLACKFIN_GPIOS
11
12#define P_SPORT2_TFS (P_DEFINED | P_IDENT(GPIO_PA0) | P_FUNCT(0)) 10#define P_SPORT2_TFS (P_DEFINED | P_IDENT(GPIO_PA0) | P_FUNCT(0))
13#define P_SPORT2_DTSEC (P_DEFINED | P_IDENT(GPIO_PA1) | P_FUNCT(0)) 11#define P_SPORT2_DTSEC (P_DEFINED | P_IDENT(GPIO_PA1) | P_FUNCT(0))
14#define P_SPORT2_DTPRI (P_DEFINED | P_IDENT(GPIO_PA2) | P_FUNCT(0)) 12#define P_SPORT2_DTPRI (P_DEFINED | P_IDENT(GPIO_PA2) | P_FUNCT(0))