|
@@ -293,3 +293,143 @@ static struct gpio_led_platform_data dns323ab_led_data = {
|
|
|
.leds = dns323ab_leds,
|
|
|
.gpio_blink_set = orion_gpio_led_blink_set,
|
|
|
};
|
|
|
+
|
|
|
+static struct gpio_led_platform_data dns323c_led_data = {
|
|
|
+ .num_leds = ARRAY_SIZE(dns323c_leds),
|
|
|
+ .leds = dns323c_leds,
|
|
|
+ .gpio_blink_set = orion_gpio_led_blink_set,
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device dns323_gpio_leds = {
|
|
|
+ .name = "leds-gpio",
|
|
|
+ .id = -1,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &dns323ab_led_data,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+/****************************************************************************
|
|
|
+ * GPIO Attached Keys
|
|
|
+ */
|
|
|
+
|
|
|
+static struct gpio_keys_button dns323ab_buttons[] = {
|
|
|
+ {
|
|
|
+ .code = KEY_RESTART,
|
|
|
+ .gpio = DNS323_GPIO_KEY_RESET,
|
|
|
+ .desc = "Reset Button",
|
|
|
+ .active_low = 1,
|
|
|
+ }, {
|
|
|
+ .code = KEY_POWER,
|
|
|
+ .gpio = DNS323_GPIO_KEY_POWER,
|
|
|
+ .desc = "Power Button",
|
|
|
+ .active_low = 1,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct gpio_keys_platform_data dns323ab_button_data = {
|
|
|
+ .buttons = dns323ab_buttons,
|
|
|
+ .nbuttons = ARRAY_SIZE(dns323ab_buttons),
|
|
|
+};
|
|
|
+
|
|
|
+static struct gpio_keys_button dns323c_buttons[] = {
|
|
|
+ {
|
|
|
+ .code = KEY_POWER,
|
|
|
+ .gpio = DNS323C_GPIO_KEY_POWER,
|
|
|
+ .desc = "Power Button",
|
|
|
+ .active_low = 1,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct gpio_keys_platform_data dns323c_button_data = {
|
|
|
+ .buttons = dns323c_buttons,
|
|
|
+ .nbuttons = ARRAY_SIZE(dns323c_buttons),
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device dns323_button_device = {
|
|
|
+ .name = "gpio-keys",
|
|
|
+ .id = -1,
|
|
|
+ .num_resources = 0,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &dns323ab_button_data,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+/*****************************************************************************
|
|
|
+ * SATA
|
|
|
+ */
|
|
|
+static struct mv_sata_platform_data dns323_sata_data = {
|
|
|
+ .n_ports = 2,
|
|
|
+};
|
|
|
+
|
|
|
+/****************************************************************************
|
|
|
+ * General Setup
|
|
|
+ */
|
|
|
+static unsigned int dns323a_mpp_modes[] __initdata = {
|
|
|
+ MPP0_PCIE_RST_OUTn,
|
|
|
+ MPP1_GPIO, /* right amber LED (sata ch0) */
|
|
|
+ MPP2_GPIO, /* left amber LED (sata ch1) */
|
|
|
+ MPP3_UNUSED,
|
|
|
+ MPP4_GPIO, /* power button LED */
|
|
|
+ MPP5_GPIO, /* power button LED */
|
|
|
+ MPP6_GPIO, /* GMT G751-2f overtemp */
|
|
|
+ MPP7_GPIO, /* M41T80 nIRQ/OUT/SQW */
|
|
|
+ MPP8_GPIO, /* triggers power off */
|
|
|
+ MPP9_GPIO, /* power button switch */
|
|
|
+ MPP10_GPIO, /* reset button switch */
|
|
|
+ MPP11_UNUSED,
|
|
|
+ MPP12_UNUSED,
|
|
|
+ MPP13_UNUSED,
|
|
|
+ MPP14_UNUSED,
|
|
|
+ MPP15_UNUSED,
|
|
|
+ MPP16_UNUSED,
|
|
|
+ MPP17_UNUSED,
|
|
|
+ MPP18_UNUSED,
|
|
|
+ MPP19_UNUSED,
|
|
|
+ 0,
|
|
|
+};
|
|
|
+
|
|
|
+static unsigned int dns323b_mpp_modes[] __initdata = {
|
|
|
+ MPP0_UNUSED,
|
|
|
+ MPP1_GPIO, /* right amber LED (sata ch0) */
|
|
|
+ MPP2_GPIO, /* left amber LED (sata ch1) */
|
|
|
+ MPP3_GPIO, /* system up flag */
|
|
|
+ MPP4_GPIO, /* power button LED */
|
|
|
+ MPP5_GPIO, /* power button LED */
|
|
|
+ MPP6_GPIO, /* GMT G751-2f overtemp */
|
|
|
+ MPP7_GPIO, /* M41T80 nIRQ/OUT/SQW */
|
|
|
+ MPP8_GPIO, /* triggers power off */
|
|
|
+ MPP9_GPIO, /* power button switch */
|
|
|
+ MPP10_GPIO, /* reset button switch */
|
|
|
+ MPP11_UNUSED,
|
|
|
+ MPP12_SATA_LED,
|
|
|
+ MPP13_SATA_LED,
|
|
|
+ MPP14_SATA_LED,
|
|
|
+ MPP15_SATA_LED,
|
|
|
+ MPP16_UNUSED,
|
|
|
+ MPP17_UNUSED,
|
|
|
+ MPP18_UNUSED,
|
|
|
+ MPP19_UNUSED,
|
|
|
+ 0,
|
|
|
+};
|
|
|
+
|
|
|
+static unsigned int dns323c_mpp_modes[] __initdata = {
|
|
|
+ MPP0_GPIO, /* ? input */
|
|
|
+ MPP1_GPIO, /* input power switch (0 = pressed) */
|
|
|
+ MPP2_GPIO, /* output power off */
|
|
|
+ MPP3_UNUSED, /* ? output */
|
|
|
+ MPP4_UNUSED, /* ? output */
|
|
|
+ MPP5_UNUSED, /* ? output */
|
|
|
+ MPP6_UNUSED, /* ? output */
|
|
|
+ MPP7_UNUSED, /* ? output */
|
|
|
+ MPP8_GPIO, /* i/o right amber LED */
|
|
|
+ MPP9_GPIO, /* i/o left amber LED */
|
|
|
+ MPP10_GPIO, /* input */
|
|
|
+ MPP11_UNUSED,
|
|
|
+ MPP12_SATA_LED,
|
|
|
+ MPP13_SATA_LED,
|
|
|
+ MPP14_SATA_LED,
|
|
|
+ MPP15_SATA_LED,
|
|
|
+ MPP16_UNUSED,
|
|
|
+ MPP17_GPIO, /* power button LED */
|
|
|
+ MPP18_GPIO, /* fan speed bit 0 */
|
|
|
+ MPP19_GPIO, /* fan speed bit 1 */
|