1 // SPDX-License-Identifier: GPL-2.0
3 // Copyright (C) 2010 Maurus Cuelenaere
6 #include <linux/gpio.h>
7 #include <linux/gpio_keys.h>
8 #include <linux/init.h>
9 #include <linux/input.h>
10 #include <linux/leds.h>
11 #include <linux/platform_device.h>
13 #include <asm/mach-types.h>
14 #include <asm/mach/arch.h>
16 #include <video/samsung_fimd.h>
17 #include <mach/irqs.h>
19 #include "regs-gpio.h"
20 #include "gpio-samsung.h"
28 #include "mach-smartq.h"
30 static struct gpio_led smartq5_leds
[] = {
32 .name
= "smartq5:green",
34 .gpio
= S3C64XX_GPN(8),
37 .name
= "smartq5:red",
39 .gpio
= S3C64XX_GPN(9),
43 static struct gpio_led_platform_data smartq5_led_data
= {
44 .num_leds
= ARRAY_SIZE(smartq5_leds
),
48 static struct platform_device smartq5_leds_device
= {
51 .dev
.platform_data
= &smartq5_led_data
,
54 /* Labels according to the SmartQ manual */
55 static struct gpio_keys_button smartq5_buttons
[] = {
57 .gpio
= S3C64XX_GPL(14),
61 .debounce_interval
= 5,
65 .gpio
= S3C64XX_GPN(2),
69 .debounce_interval
= 5,
73 .gpio
= S3C64XX_GPN(12),
77 .debounce_interval
= 5,
81 .gpio
= S3C64XX_GPN(15),
85 .debounce_interval
= 5,
90 static struct gpio_keys_platform_data smartq5_buttons_data
= {
91 .buttons
= smartq5_buttons
,
92 .nbuttons
= ARRAY_SIZE(smartq5_buttons
),
95 static struct platform_device smartq5_buttons_device
= {
100 .platform_data
= &smartq5_buttons_data
,
104 static struct s3c_fb_pd_win smartq5_fb_win0
= {
111 static struct fb_videomode smartq5_lcd_timing
= {
123 static struct s3c_fb_platdata smartq5_lcd_pdata __initdata
= {
124 .setup_gpio
= s3c64xx_fb_gpio_setup_24bpp
,
125 .vtiming
= &smartq5_lcd_timing
,
126 .win
[0] = &smartq5_fb_win0
,
127 .vidcon0
= VIDCON0_VIDOUT_RGB
| VIDCON0_PNRMODE_RGB
,
128 .vidcon1
= VIDCON1_INV_HSYNC
| VIDCON1_INV_VSYNC
|
132 static struct platform_device
*smartq5_devices
[] __initdata
= {
133 &smartq5_leds_device
,
134 &smartq5_buttons_device
,
137 static void __init
smartq5_machine_init(void)
139 s3c_fb_set_platdata(&smartq5_lcd_pdata
);
141 smartq_machine_init();
143 platform_add_devices(smartq5_devices
, ARRAY_SIZE(smartq5_devices
));
146 MACHINE_START(SMARTQ5
, "SmartQ 5")
147 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
148 .atag_offset
= 0x100,
149 .nr_irqs
= S3C64XX_NR_IRQS
,
150 .init_irq
= s3c6410_init_irq
,
151 .map_io
= smartq_map_io
,
152 .init_machine
= smartq5_machine_init
,
153 .init_time
= s3c64xx_timer_init
,