summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_x1000/erosqnative/gpio-target.h
blob: 72052c261fd44ea4bc96b0fed811d9602b4118c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* -------------------- NOTES ------------------- */

/* I don't think we have any devices on I2C1, the pins /may/ be reused. */
/* DEFINE_PINGROUP(I2C1,           GPIO_C,      3 << 26,   GPIOF_DEVICE(0)) */

/* OF has SD Card power listed as 0x2a - PB10, but it seems to work without. */

/* I think BT power reg is pin 0x53 - C19 */

/* USB_DETECT D3 chosen by trial-and-error. */

/* I have a suspicion this isn't right for AXP_IRQ,
 * and it's not used right now anyway.  copied from m3k. */
/* DEFINE_GPIO(AXP_IRQ,            GPIO_PB(10),    GPIOF_INPUT) */

/* ---------------------------------------------- */


/*              Name            Port    Pins            Function */
DEFINE_PINGROUP(LCD_DATA,       GPIO_A, 0xffff <<  0,   GPIOF_DEVICE(1))
DEFINE_PINGROUP(LCD_CONTROL,    GPIO_B,   0x1a << 16,   GPIOF_DEVICE(1))
DEFINE_PINGROUP(MSC0,           GPIO_A,   0x3f << 20,   GPIOF_DEVICE(1))
DEFINE_PINGROUP(SFC,            GPIO_A,   0x3f << 26,   GPIOF_DEVICE(1))
DEFINE_PINGROUP(I2S,            GPIO_B,   0x1f <<  0,   GPIOF_DEVICE(1))
DEFINE_PINGROUP(I2C1,           GPIO_C,      3 << 26,   GPIOF_DEVICE(0))
DEFINE_PINGROUP(I2C2,           GPIO_D,      3 <<  0,   GPIOF_DEVICE(1))

/*          Name                Pin             Function */
/* mute DAC: 0 - mute, 1 - play */
/* Note: This seems to actually be power to the DAC in general,
 * at least on the ES9018K2M devices. Was "DAC_XMIT". */
DEFINE_GPIO(DAC_PWR,           GPIO_PB(12),    GPIOF_OUTPUT(0))

/* mute HP amp: 0 - mute, 1 - play */
DEFINE_GPIO(HPAMP_SHDN,         GPIO_PB(8),     GPIOF_OUTPUT(0))

/* mute audio mux: 0 - play, 1 - mute */
DEFINE_GPIO(STEREOSW_MUTE,      GPIO_PB(15),    GPIOF_OUTPUT(1))

/*
 * Original devices: switches HP on/off - 0 HP on, 1 HP off, no effect on LO.
 * Newer devices: switches between HP and LO - 0 HP, 1 LO.
 */
DEFINE_GPIO(STEREOSW_SEL,       GPIO_PB(5),     GPIOF_OUTPUT(0))

/* DAC AVDD */
DEFINE_GPIO(DAC_ANALOG_PWR,     GPIO_PB(9),     GPIOF_OUTPUT(0))

/* Headphone Amp power */
DEFINE_GPIO(HPAMP_POWER,        GPIO_PB(6),     GPIOF_OUTPUT(0))

/* SD card */
DEFINE_GPIO(MSC0_CD,            GPIO_PB(11),    GPIOF_INPUT)

/* USB */
DEFINE_GPIO(USB_DETECT,         GPIO_PD(3),     GPIOF_INPUT)
DEFINE_GPIO(USB_DRVVBUS,        GPIO_PB(25),    GPIOF_OUTPUT(0))

/* LCD */
DEFINE_GPIO(LCD_PWR,            GPIO_PB(14),    GPIOF_OUTPUT(0))
DEFINE_GPIO(LCD_RESET,          GPIO_PB(13),    GPIOF_OUTPUT(0))
DEFINE_GPIO(LCD_CE,             GPIO_PB(18),    GPIOF_OUTPUT(1))
DEFINE_GPIO(LCD_RD,             GPIO_PB(16),    GPIOF_OUTPUT(1))

/* Buttons */
DEFINE_GPIO(BTN_PLAY,           GPIO_PA(16),    GPIOF_INPUT)
DEFINE_GPIO(BTN_VOL_UP,         GPIO_PA(17),    GPIOF_INPUT)
DEFINE_GPIO(BTN_VOL_DOWN,       GPIO_PA(19),    GPIOF_INPUT)
DEFINE_GPIO(BTN_POWER,          GPIO_PB(7),     GPIOF_INPUT)
DEFINE_GPIO(BTN_MENU,           GPIO_PB(28),    GPIOF_INPUT)
DEFINE_GPIO(BTN_BACK,           GPIO_PD(5),     GPIOF_INPUT)
DEFINE_GPIO(BTN_PREV,           GPIO_PD(4),     GPIOF_INPUT)
DEFINE_GPIO(BTN_NEXT,           GPIO_PC(24),    GPIOF_INPUT)
DEFINE_GPIO(BTN_SCROLL_A,       GPIO_PB(24),    GPIOF_INPUT)
DEFINE_GPIO(BTN_SCROLL_B,       GPIO_PB(23),    GPIOF_INPUT)