Lines Matching +full:gpio +full:- +full:key
1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/arch/arm/mach-omap1/board-ams-delta.c
5 * Modified from board-generic.c
11 #include <linux/gpio/driver.h>
12 #include <linux/gpio/machine.h>
13 #include <linux/gpio/consumer.h>
14 #include <linux/gpio.h>
20 #include <linux/mtd/nand-gpio.h>
30 #include <linux/platform_data/gpio-omap.h>
33 #include <asm/mach-types.h>
37 #include <linux/platform_data/keypad-omap.h>
43 #include "ams-delta-fiq.h"
44 #include "board-ams-delta.h"
49 KEY(0, 0, KEY_F1), /* Advert */
51 KEY(0, 3, KEY_COFFEE), /* Games */
52 KEY(0, 2, KEY_QUESTION), /* Directory */
53 KEY(2, 3, KEY_CONNECT), /* Internet */
54 KEY(1, 2, KEY_SHOP), /* Services */
55 KEY(1, 1, KEY_PHONE), /* VoiceMail */
57 KEY(0, 1, KEY_DELETE), /* Delete */
58 KEY(2, 2, KEY_PLAY), /* Play */
59 KEY(1, 0, KEY_PAGEUP), /* Up */
60 KEY(1, 3, KEY_PAGEDOWN), /* Down */
61 KEY(2, 0, KEY_EMAIL), /* ReadEmail */
62 KEY(2, 1, KEY_STOP), /* Stop */
65 KEY(0, 7, KEY_KP1),
66 KEY(0, 6, KEY_KP2),
67 KEY(0, 5, KEY_KP3),
68 KEY(1, 7, KEY_KP4),
69 KEY(1, 6, KEY_KP5),
70 KEY(1, 5, KEY_KP6),
71 KEY(2, 7, KEY_KP7),
72 KEY(2, 6, KEY_KP8),
73 KEY(2, 5, KEY_KP9),
74 KEY(3, 6, KEY_KP0),
75 KEY(3, 7, KEY_KPASTERISK),
76 KEY(3, 5, KEY_KPDOT), /* # key */
77 KEY(7, 2, KEY_NUMLOCK), /* Mute */
78 KEY(7, 1, KEY_KPMINUS), /* Recall */
79 KEY(6, 1, KEY_KPPLUS), /* Redial */
80 KEY(7, 6, KEY_KPSLASH), /* Handsfree */
81 KEY(6, 0, KEY_ENTER), /* Video */
83 KEY(7, 4, KEY_CAMERA), /* Photo */
85 KEY(0, 4, KEY_F2), /* Home */
86 KEY(1, 4, KEY_F3), /* Office */
87 KEY(2, 4, KEY_F4), /* Mobile */
88 KEY(7, 7, KEY_F5), /* SMS */
89 KEY(7, 5, KEY_F6), /* Email */
92 KEY(3, 4, KEY_Q),
93 KEY(3, 3, KEY_W),
94 KEY(3, 2, KEY_E),
95 KEY(3, 1, KEY_R),
96 KEY(3, 0, KEY_T),
97 KEY(4, 7, KEY_Y),
98 KEY(4, 6, KEY_U),
99 KEY(4, 5, KEY_I),
100 KEY(4, 4, KEY_O),
101 KEY(4, 3, KEY_P),
103 KEY(4, 2, KEY_A),
104 KEY(4, 1, KEY_S),
105 KEY(4, 0, KEY_D),
106 KEY(5, 7, KEY_F),
107 KEY(5, 6, KEY_G),
108 KEY(5, 5, KEY_H),
109 KEY(5, 4, KEY_J),
110 KEY(5, 3, KEY_K),
111 KEY(5, 2, KEY_L),
113 KEY(5, 1, KEY_Z),
114 KEY(5, 0, KEY_X),
115 KEY(6, 7, KEY_C),
116 KEY(6, 6, KEY_V),
117 KEY(6, 5, KEY_B),
118 KEY(6, 4, KEY_N),
119 KEY(6, 3, KEY_M),
120 KEY(6, 2, KEY_SPACE),
122 KEY(7, 0, KEY_LEFTSHIFT), /* Vol up */
123 KEY(7, 3, KEY_LEFTCTRL), /* Vol down */
173 .end = LATCH1_PHYS + (LATCH1_NGPIO - 1) / 8,
182 .base = -1,
187 .name = "basic-mmio-gpio",
211 .end = LATCH2_PHYS + (LATCH2_NGPIO - 1) / 8,
220 .base = -1,
225 .name = "basic-mmio-gpio",
253 REGULATOR_SUPPLY("POR", "cx20442-codec"),
274 .name = "reg-fixed-voltage",
275 .id = -1,
282 .dev_id = "reg-fixed-voltage",
304 { .name = "u-boot",
307 { .name = "u-boot params",
317 .offset = 32 * SZ_1M - 3 * SZ_256K,
327 .name = "ams-delta-nand",
328 .id = -1,
334 #define OMAP_GPIO_LABEL "gpio-0-15"
384 .name = "omap-keypad",
385 .id = -1,
395 .id = -1,
464 .name = "ams-delta-audio",
465 .id = -1,
483 .name = "cx20442-codec",
484 .id = -1,
492 * It will be replaced with dynamically allocated GPIO IRQ
493 * obtained from GPIO chip as soon as the chip is available.
495 .start = -EINVAL,
496 .end = -EINVAL,
501 .name = "ams-delta-serio",
538 .name = "reg-fixed-voltage",
573 * Some drivers may not use GPIO lookup tables but need to be provided
574 * with GPIO numbers. The same applies to GPIO based IRQ lines - some
575 * drivers may even not use GPIO layer but expect just IRQ numbers.
576 * We could either define GPIO lookup tables then use them on behalf
577 * of those devices, or we can use GPIO driver level methods for
578 * identification of GPIO and IRQ numbers. For the purpose of the latter,
579 * defina a helper function which identifies GPIO chips by their labels.
585 return !strcmp(label, chip->label); in gpiochip_match_by_label()
597 * Obtain MODEM IRQ GPIO descriptor using its hardware pin
599 * Keep the GPIO descriptor open so nobody steps in.
609 pr_err("%s: modem IRQ GPIO request failed (%ld)\n", __func__, in modem_assign_irq()
618 * devices and data structures which depend on GPIO lines provided by OMAP GPIO
619 * banks but their drivers don't use GPIO lookup tables or GPIO layer at all.
620 * The function may be called as soon as OMAP GPIO devices are probed.
631 pr_err("%s: OMAP GPIO chip not found\n", __func__); in omap_gpio_deps_init()
637 * and release successfully each OMAP GPIO pin in turn. in omap_gpio_deps_init()
645 * Initialize latch2 pins with values which are safe for dependent on-board
646 * devices or useful for their successull initialization even before GPIO
648 * - LATCH2_PIN_LCD_VBLEN = 0
649 * - LATCH2_PIN_LCD_NDISP = 0 Keep LCD device powered off before its
651 * - LATCH2_PIN_NAND_NCE = 0
652 * - LATCH2_PIN_NAND_NWP = 0 Keep NAND device down and write-
655 * - LATCH2_PIN_KEYBRD_PWR = 0 Keep keyboard powered off before serio
657 * - LATCH2_PIN_KEYBRD_DATAOUT = 0 Keep low to avoid corruption of first
661 * GPIO driver as soon as it is ready.
662 * - LATCH2_PIN_MODEM_NRESET = 1 Enable voice MODEM device, allowing for
666 * - LATCH2_PIN_MODEM_CODEC = 1 Attach voice MODEM CODEC data port
729 * As soon as GPIO consumers have been registered, assign in ams_delta_init()
730 * their dev_names to respective GPIO lookup tables. in ams_delta_init()
739 * Once GPIO lookup tables are populated with dev_names, register them. in ams_delta_init()
746 leds_gpio_table.dev_id = dev_name(&leds_pdev->dev); in ams_delta_init()
757 struct modem_private_data *priv = port->private_data; in modem_pm()
763 if (IS_ERR(priv->regulator)) in modem_pm()
770 ret = regulator_enable(priv->regulator); in modem_pm()
772 ret = regulator_disable(priv->regulator); in modem_pm()
777 dev_warn(port->dev, in modem_pm()
822 * - with a descriptor of already functional modem_nreset regulator
824 * - with the regulator not yet controlled by modem_pm function but
826 * - before the modem_nreset regulator is probed, with the pin already
840 return -ENODEV; in ams_delta_modem_init()
845 modem_priv.regulator = ERR_PTR(-ENODEV); in ams_delta_modem_init()