#include <linux/kernel.h>
#include <linux/pinctrl/pinctrl.h>
#include "pinctrl-nomadik.h"
/* All the pins that can be used for GPIO and some other functions */
#define _GPIO(offset) (offset)
#define DB8540_PIN_AH6 _GPIO(0)
#define DB8540_PIN_AG7 _GPIO(1)
#define DB8540_PIN_AF2 _GPIO(2)
#define DB8540_PIN_AD3 _GPIO(3)
#define DB8540_PIN_AF6 _GPIO(4)
#define DB8540_PIN_AG6 _GPIO(5)
#define DB8540_PIN_AD5 _GPIO(6)
#define DB8540_PIN_AF7 _GPIO(7)
#define DB8540_PIN_AG5 _GPIO(8)
#define DB8540_PIN_AH5 _GPIO(9)
#define DB8540_PIN_AE4 _GPIO(10)
#define DB8540_PIN_AD1 _GPIO(11)
#define DB8540_PIN_AD2 _GPIO(12)
#define DB8540_PIN_AC2 _GPIO(13)
#define DB8540_PIN_AC4 _GPIO(14)
#define DB8540_PIN_AC3 _GPIO(15)
#define DB8540_PIN_AH7 _GPIO(16)
#define DB8540_PIN_AE7 _GPIO(17)
/* Hole */
#define DB8540_PIN_AF8 _GPIO(22)
#define DB8540_PIN_AH11 _GPIO(23)
#define DB8540_PIN_AG11 _GPIO(24)
#define DB8540_PIN_AF11 _GPIO(25)
#define DB8540_PIN_AH10 _GPIO(26)
#define DB8540_PIN_AG10 _GPIO(27)
#define DB8540_PIN_AF10 _GPIO(28)
/* Hole */
#define DB8540_PIN_AD4 _GPIO(33)
#define DB8540_PIN_AF3 _GPIO(34)
#define DB8540_PIN_AF5 _GPIO(35)
#define DB8540_PIN_AG4 _GPIO(36)
#define DB8540_PIN_AF9 _GPIO(37)
#define DB8540_PIN_AE8 _GPIO(38)
/* Hole */
#define DB8540_PIN_M26 _GPIO(64)
#define DB8540_PIN_M25 _GPIO(65)
#define DB8540_PIN_M27 _GPIO(66)
#define DB8540_PIN_N25 _GPIO(67)
/* Hole */
#define DB8540_PIN_M28 _GPIO(70)
#define DB8540_PIN_N26 _GPIO(71)
#define DB8540_PIN_M22 _GPIO(72)
#define DB8540_PIN_N22 _GPIO(73)
#define DB8540_PIN_N27 _GPIO(74)
#define DB8540_PIN_N28 _GPIO(75)
#define DB8540_PIN_P22 _GPIO(76)
#define DB8540_PIN_P28 _GPIO(77)
#define DB8540_PIN_P26 _GPIO(78)
#define DB8540_PIN_T22 _GPIO(79)
#define DB8540_PIN_R27 _GPIO(80)
#define DB8540_PIN_P27 _GPIO(81)
#define DB8540_PIN_R26 _GPIO(82)
#define DB8540_PIN_R25 _GPIO(83)
#define DB8540_PIN_U22 _GPIO(84)
#define DB8540_PIN_T27 _GPIO(85)
#define DB8540_PIN_T25 _GPIO(86)
#define DB8540_PIN_T26 _GPIO(87)
/* Hole */
#define DB8540_PIN_AF20 _GPIO(116)
#define DB8540_PIN_AG21 _GPIO(117)
#define DB8540_PIN_AH19 _GPIO(118)
#define DB8540_PIN_AE19 _GPIO(119)
#define DB8540_PIN_AG18 _GPIO(120)
#define DB8540_PIN_AH17 _GPIO(121)
#define DB8540_PIN_AF19 _GPIO(122)
#define DB8540_PIN_AF18 _GPIO(123)
#define DB8540_PIN_AE18 _GPIO(124)
#define DB8540_PIN_AG17 _GPIO(125)
#define DB8540_PIN_AF17 _GPIO(126)
#define DB8540_PIN_AE17 _GPIO(127)
#define DB8540_PIN_AC27 _GPIO(128)
#define DB8540_PIN_AD27 _GPIO(129)
#define DB8540_PIN_AE28 _GPIO(130)
#define DB8540_PIN_AG26 _GPIO(131)
#define DB8540_PIN_AF25 _GPIO(132)
#define DB8540_PIN_AE27 _GPIO(133)
#define DB8540_PIN_AF27 _GPIO(134)
#define DB8540_PIN_AG28 _GPIO(135)
#define DB8540_PIN_AF28 _GPIO(136)
#define DB8540_PIN_AG25 _GPIO(137)
#define DB8540_PIN_AG24 _GPIO(138)
#define DB8540_PIN_AD25 _GPIO(139)
#define DB8540_PIN_AH25 _GPIO(140)
#define DB8540_PIN_AF26 _GPIO(141)
#define DB8540_PIN_AF23 _GPIO(142)
#define DB8540_PIN_AG23 _GPIO(143)
#define DB8540_PIN_AE25 _GPIO(144)
#define DB8540_PIN_AH24 _GPIO(145)
#define DB8540_PIN_AJ25 _GPIO(146)
#define DB8540_PIN_AG27 _GPIO(147)
#define DB8540_PIN_AH23 _GPIO(148)
#define DB8540_PIN_AE26 _GPIO(149)
#define DB8540_PIN_AE24 _GPIO(150)
#define DB8540_PIN_AJ24 _GPIO(151)
#define DB8540_PIN_AE21 _GPIO(152)
#define DB8540_PIN_AG22 _GPIO(153)
#define DB8540_PIN_AF21 _GPIO(154)
#define DB8540_PIN_AF24 _GPIO(155)
#define DB8540_PIN_AH22 _GPIO(156)
#define DB8540_PIN_AJ23 _GPIO(157)
#define DB8540_PIN_AH21 _GPIO(158)
#define DB8540_PIN_AG20 _GPIO(159)
#define DB8540_PIN_AE23 _GPIO(160)
#define DB8540_PIN_AH20 _GPIO(161)
#define DB8540_PIN_AG19 _GPIO(162)
#define DB8540_PIN_AF22 _GPIO(163)
#define DB8540_PIN_AJ21 _GPIO(164)
#define DB8540_PIN_AD26 _GPIO(165)
#define DB8540_PIN_AD28 _GPIO(166)
#define DB8540_PIN_AC28 _GPIO(167)
#define DB8540_PIN_AC26 _GPIO(168)
/* Hole */
#define DB8540_PIN_J3 _GPIO(192)
#define DB8540_PIN_H1 _GPIO(193)
#define DB8540_PIN_J2 _GPIO(194)
#define DB8540_PIN_H2 _GPIO(195)
#define DB8540_PIN_H3 _GPIO(196)
#define DB8540_PIN_H4 _GPIO(197)
#define DB8540_PIN_G2 _GPIO(198)
#define DB8540_PIN_G3 _GPIO(199)
#define DB8540_PIN_G4 _GPIO(200)
#define DB8540_PIN_F2 _GPIO(201)
#define DB8540_PIN_C6 _GPIO(202)
#define DB8540_PIN_B6 _GPIO(203)
#define DB8540_PIN_B7 _GPIO(204)
#define DB8540_PIN_A7 _GPIO(205)
#define DB8540_PIN_D7 _GPIO(206)
#define DB8540_PIN_D8 _GPIO(207)
#define DB8540_PIN_F3 _GPIO(208)
#define DB8540_PIN_E2 _GPIO(209)
#define DB8540_PIN_C7 _GPIO(210)
#define DB8540_PIN_B8 _GPIO(211)
#define DB8540_PIN_C10 _GPIO(212)
#define DB8540_PIN_C8 _GPIO(213)
#define DB8540_PIN_C9 _GPIO(214)
/* Hole */
#define DB8540_PIN_B9 _GPIO(219)
#define DB8540_PIN_A10 _GPIO(220)
#define DB8540_PIN_D9 _GPIO(221)
#define DB8540_PIN_B11 _GPIO(222)
#define DB8540_PIN_B10 _GPIO(223)
#define DB8540_PIN_E10 _GPIO(224)
#define DB8540_PIN_B12 _GPIO(225)
#define DB8540_PIN_D10 _GPIO(226)
#define DB8540_PIN_D11 _GPIO(227)
#define DB8540_PIN_AJ6 _GPIO(228)
#define DB8540_PIN_B13 _GPIO(229)
#define DB8540_PIN_C12 _GPIO(230)
#define DB8540_PIN_B14 _GPIO(231)
#define DB8540_PIN_E11 _GPIO(232)
/* Hole */
#define DB8540_PIN_D12 _GPIO(256)
#define DB8540_PIN_D15 _GPIO(257)
#define DB8540_PIN_C13 _GPIO(258)
#define DB8540_PIN_C14 _GPIO(259)
#define DB8540_PIN_C18 _GPIO(260)
#define DB8540_PIN_C16 _GPIO(261)
#define DB8540_PIN_B16 _GPIO(262)
#define DB8540_PIN_D18 _GPIO(263)
#define DB8540_PIN_C15 _GPIO(264)
#define DB8540_PIN_C17 _GPIO(265)
#define DB8540_PIN_B17 _GPIO(266)
#define DB8540_PIN_D17 _GPIO(267)
/*
* The names of the pins are denoted by GPIO number and ball name, even
* though they can be used for other things than GPIO, this is the first
* column in the table of the data sheet and often used on schematics and
* such.
*/
static const struct pinctrl_pin_desc nmk_db8540_pins[] = {
PINCTRL_PIN(DB8540_PIN_AH6, "GPIO0_AH6"),
PINCTRL_PIN(DB8540_PIN_AG7, "GPIO1_AG7"),
PINCTRL_PIN(DB8540_PIN_AF2, "GPIO2_AF2"),
PINCTRL_PIN(DB8540_PIN_AD3, "GPIO3_AD3"),
PINCTRL_PIN(DB8540_PIN_AF6, "GPIO4_AF6"),
PINCTRL_PIN(DB8540_PIN_AG6, "GPIO5_AG6"),
PINCTRL_PIN(DB8540_PIN_AD5, "GPIO6_AD5"),
PINCTRL_PIN(DB8540_PIN_AF7, "GPIO7_AF7"),
PINCTRL_PIN(DB8540_PIN_AG5, "GPIO8_AG5"),
PINCTRL_PIN(DB8540_PIN_AH5, "GPIO9_AH5"),
PINCTRL_PIN(DB8540_PIN_AE4, "GPIO10_AE4"),
PINCTRL_PIN(DB8540_PIN_AD1