Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) //
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) // Machine specific code for the Acer n30, Acer N35, Navman PiN 570,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) // Yakumo AlphaX and Airis NC05 PDAs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) //
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) // Copyright (c) 2003-2005 Simtec Electronics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) //	Ben Dooks <ben@simtec.co.uk>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) //
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) // Copyright (c) 2005-2008 Christer Weinigel <christer@weinigel.se>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) //
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) // There is a wiki with more information about the n30 port at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) // https://handhelds.org/moin/moin.cgi/AcerN30Documentation .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/gpio_keys.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <linux/gpio/machine.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <linux/input.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <linux/serial_core.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include <linux/serial_s3c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include <linux/timer.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include <linux/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #include <linux/mmc/host.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #include "hardware-s3c24xx.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #include <asm/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #include <asm/mach-types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #include <linux/platform_data/fb-s3c2410.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #include <linux/platform_data/leds-s3c24xx.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) #include "regs-gpio.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #include "gpio-samsung.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #include "gpio-cfg.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #include <asm/mach/arch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) #include <asm/mach/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) #include <asm/mach/map.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) #include <linux/platform_data/i2c-s3c2410.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #include "cpu.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #include "devs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #include <linux/platform_data/mmc-s3cmci.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) #include <linux/platform_data/usb-s3c2410_udc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) #include "s3c24xx.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) static struct map_desc n30_iodesc[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	/* nothing here yet */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) static struct s3c2410_uartcfg n30_uartcfgs[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	/* Normal serial port */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	[0] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 		.hwport	     = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 		.flags	     = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 		.ucon	     = 0x2c5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 		.ulcon	     = 0x03,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		.ufcon	     = 0x51,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	/* IR port */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	[1] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 		.hwport	     = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 		.flags	     = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 		.uart_flags  = UPF_CONS_FLOW,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 		.ucon	     = 0x2c5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 		.ulcon	     = 0x43,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 		.ufcon	     = 0x51,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	/* On the N30 the bluetooth controller is connected here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	 * On the N35 and variants the GPS receiver is connected here. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	[2] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		.hwport	     = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		.flags	     = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 		.ucon	     = 0x2c5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 		.ulcon	     = 0x03,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		.ufcon	     = 0x51,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) static struct s3c2410_udc_mach_info n30_udc_cfg __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	.vbus_pin		= S3C2410_GPG(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	.vbus_pin_inverted	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	.pullup_pin		= S3C2410_GPB(3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) static struct gpio_keys_button n30_buttons[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		.gpio		= S3C2410_GPF(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		.code		= KEY_POWER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 		.desc		= "Power",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 		.gpio		= S3C2410_GPG(9),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 		.code		= KEY_UP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		.desc		= "Thumbwheel Up",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		.gpio		= S3C2410_GPG(8),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		.code		= KEY_DOWN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		.desc		= "Thumbwheel Down",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 		.gpio		= S3C2410_GPG(7),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		.code		= KEY_ENTER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		.desc		= "Thumbwheel Press",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		.gpio		= S3C2410_GPF(7),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		.code		= KEY_HOMEPAGE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		.desc		= "Home",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		.gpio		= S3C2410_GPF(6),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 		.code		= KEY_CALENDAR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		.desc		= "Calendar",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		.gpio		= S3C2410_GPF(5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		.code		= KEY_ADDRESSBOOK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		.desc		= "Contacts",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 		.gpio		= S3C2410_GPF(4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 		.code		= KEY_MAIL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		.desc		= "Mail",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) static struct gpio_keys_platform_data n30_button_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	.buttons	= n30_buttons,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	.nbuttons	= ARRAY_SIZE(n30_buttons),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) static struct platform_device n30_button_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	.name		= "gpio-keys",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	.id		= -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	.dev		= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		.platform_data	= &n30_button_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) static struct gpio_keys_button n35_buttons[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		.gpio		= S3C2410_GPF(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		.code		= KEY_POWER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 		.type		= EV_PWR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		.desc		= "Power",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		.wakeup		= 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 		.gpio		= S3C2410_GPG(9),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		.code		= KEY_UP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		.desc		= "Joystick Up",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		.gpio		= S3C2410_GPG(8),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		.code		= KEY_DOWN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 		.desc		= "Joystick Down",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 		.gpio		= S3C2410_GPG(6),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		.code		= KEY_DOWN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		.desc		= "Joystick Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		.gpio		= S3C2410_GPG(5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 		.code		= KEY_DOWN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		.desc		= "Joystick Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		.gpio		= S3C2410_GPG(7),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		.code		= KEY_ENTER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 		.desc		= "Joystick Press",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 		.gpio		= S3C2410_GPF(7),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 		.code		= KEY_HOMEPAGE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 		.desc		= "Home",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 		.gpio		= S3C2410_GPF(6),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		.code		= KEY_CALENDAR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 		.desc		= "Calendar",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 		.gpio		= S3C2410_GPF(5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 		.code		= KEY_ADDRESSBOOK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 		.desc		= "Contacts",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 		.gpio		= S3C2410_GPF(4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 		.code		= KEY_MAIL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 		.desc		= "Mail",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 		.gpio		= S3C2410_GPF(3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 		.code		= SW_RADIO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 		.desc		= "GPS Antenna",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 		.gpio		= S3C2410_GPG(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 		.code		= SW_HEADPHONE_INSERT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 		.desc		= "Headphone",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 		.active_low	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) static struct gpio_keys_platform_data n35_button_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	.buttons	= n35_buttons,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	.nbuttons	= ARRAY_SIZE(n35_buttons),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) static struct platform_device n35_button_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	.name		= "gpio-keys",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	.id		= -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	.num_resources	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	.dev		= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 		.platform_data	= &n35_button_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) /* This is the bluetooth LED on the device. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) static struct gpiod_lookup_table n30_blue_led_gpio_table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	.dev_id = "s3c24xx_led.1",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	.table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 		GPIO_LOOKUP("GPG", 6, NULL, GPIO_ACTIVE_HIGH),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 		{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) static struct s3c24xx_led_platdata n30_blue_led_pdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	.name		= "blue_led",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	.def_trigger	= "",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) /* This is the blue LED on the device. Originally used to indicate GPS activity
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)  * by flashing. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) static struct gpiod_lookup_table n35_blue_led_gpio_table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 	.dev_id = "s3c24xx_led.1",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 	.table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 		GPIO_LOOKUP("GPD", 8, NULL, GPIO_ACTIVE_HIGH),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 		{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) static struct s3c24xx_led_platdata n35_blue_led_pdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 	.name		= "blue_led",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 	.def_trigger	= "",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) /* This LED is driven by the battery microcontroller, and is blinking
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)  * red, blinking green or solid green when the battery is low,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)  * charging or full respectively.  By driving GPD9 low, it's possible
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281)  * to force the LED to blink red, so call that warning LED.  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) static struct gpiod_lookup_table n30_warning_led_gpio_table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 	.dev_id = "s3c24xx_led.2",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	.table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 		GPIO_LOOKUP("GPD", 9, NULL, GPIO_ACTIVE_LOW),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 		{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) static struct s3c24xx_led_platdata n30_warning_led_pdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 	.name		= "warning_led",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 	.def_trigger	= "",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) static struct gpiod_lookup_table n35_warning_led_gpio_table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 	.dev_id = "s3c24xx_led.2",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 	.table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 		GPIO_LOOKUP("GPD", 9, NULL, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 		{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) static struct s3c24xx_led_platdata n35_warning_led_pdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 	.name		= "warning_led",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 	.def_trigger	= "",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) static struct platform_device n30_blue_led = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 	.name		= "s3c24xx_led",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 	.id		= 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 	.dev		= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 		.platform_data	= &n30_blue_led_pdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) static struct platform_device n35_blue_led = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 	.name		= "s3c24xx_led",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 	.id		= 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 	.dev		= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 		.platform_data	= &n35_blue_led_pdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) static struct platform_device n30_warning_led = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 	.name		= "s3c24xx_led",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 	.id		= 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 	.dev		= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 		.platform_data	= &n30_warning_led_pdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) static struct platform_device n35_warning_led = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 	.name		= "s3c24xx_led",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 	.id		= 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 	.dev		= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 		.platform_data	= &n35_warning_led_pdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) static struct s3c2410fb_display n30_display __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 	.type		= S3C2410_LCDCON1_TFT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 	.width		= 240,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 	.height		= 320,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 	.pixclock	= 170000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 	.xres		= 240,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 	.yres		= 320,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 	.bpp		= 16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 	.left_margin	= 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 	.right_margin	= 40,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 	.hsync_len	= 40,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 	.upper_margin	= 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 	.lower_margin	= 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 	.vsync_len	= 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 	.lcdcon5 = S3C2410_LCDCON5_INVVLINE | S3C2410_LCDCON5_INVVFRAME,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) static struct s3c2410fb_mach_info n30_fb_info __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 	.displays	= &n30_display,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 	.num_displays	= 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 	.default_display = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 	.lpcsel		= 0x06,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) static void n30_sdi_set_power(unsigned char power_mode, unsigned short vdd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 	s3c24xx_mci_def_set_power(power_mode, vdd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 	switch (power_mode) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 	case MMC_POWER_ON:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 	case MMC_POWER_UP:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 		gpio_set_value(S3C2410_GPG(4), 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 	case MMC_POWER_OFF:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 		gpio_set_value(S3C2410_GPG(4), 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) static struct s3c24xx_mci_pdata n30_mci_cfg __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 	.ocr_avail	= MMC_VDD_32_33,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 	.set_power	= n30_sdi_set_power,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) static struct gpiod_lookup_table n30_mci_gpio_table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 	.dev_id = "s3c2410-sdi",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 	.table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 		/* Card detect S3C2410_GPF(1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 		GPIO_LOOKUP("GPIOF", 1, "cd", GPIO_ACTIVE_LOW),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 		/* Write protect S3C2410_GPG(10) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 		GPIO_LOOKUP("GPIOG", 10, "wp", GPIO_ACTIVE_LOW),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 		{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 		/* bus pins */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 		GPIO_LOOKUP_IDX("GPIOE",  5, "bus", 0, GPIO_ACTIVE_HIGH),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 		GPIO_LOOKUP_IDX("GPIOE",  6, "bus", 1, GPIO_ACTIVE_HIGH),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 		GPIO_LOOKUP_IDX("GPIOE",  7, "bus", 2, GPIO_ACTIVE_HIGH),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 		GPIO_LOOKUP_IDX("GPIOE",  8, "bus", 3, GPIO_ACTIVE_HIGH),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 		GPIO_LOOKUP_IDX("GPIOE",  9, "bus", 4, GPIO_ACTIVE_HIGH),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 		GPIO_LOOKUP_IDX("GPIOE", 10, "bus", 5, GPIO_ACTIVE_HIGH),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) static struct platform_device *n30_devices[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) 	&s3c_device_lcd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 	&s3c_device_wdt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 	&s3c_device_i2c0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 	&s3c_device_iis,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 	&s3c_device_ohci,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 	&s3c_device_rtc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 	&s3c_device_usbgadget,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 	&s3c_device_sdi,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 	&n30_button_device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 	&n30_blue_led,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 	&n30_warning_led,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) static struct platform_device *n35_devices[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 	&s3c_device_lcd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 	&s3c_device_wdt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 	&s3c_device_i2c0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 	&s3c_device_iis,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 	&s3c_device_rtc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 	&s3c_device_usbgadget,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 	&s3c_device_sdi,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 	&n35_button_device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 	&n35_blue_led,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 	&n35_warning_led,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) static struct s3c2410_platform_i2c __initdata n30_i2ccfg = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 	.flags		= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 	.slave_addr	= 0x10,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 	.frequency	= 10*1000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) /* Lots of hardcoded stuff, but it sets up the hardware in a useful
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440)  * state so that we can boot Linux directly from flash. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) static void __init n30_hwinit(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 	/* GPA0-11 special functions -- unknown what they do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 	 * GPA12 N30 special function -- unknown what it does
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 	 *       N35/PiN output -- unknown what it does
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 	 * A12 is nGCS1 on the N30 and an output on the N35/PiN.  I
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 	 * don't think it does anything useful on the N30, so I ought
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 	 * to make it an output there too since it always driven to 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) 	 * as far as I can tell. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 	if (machine_is_n30())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) 		__raw_writel(0x007fffff, S3C2410_GPACON);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) 	if (machine_is_n35())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 		__raw_writel(0x007fefff, S3C2410_GPACON);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 	__raw_writel(0x00000000, S3C2410_GPADAT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 	/* GPB0 TOUT0 backlight level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 	 * GPB1 output 1=backlight on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 	 * GPB2 output IrDA enable 0=transceiver enabled, 1=disabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 	 * GPB3 output USB D+ pull up 0=disabled, 1=enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 	 * GPB4 N30 output -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 	 *      N30/PiN GPS control 0=GPS enabled, 1=GPS disabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 	 * GPB5 output -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 	 * GPB6 input -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 	 * GPB7 output -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 	 * GPB8 output -- probably LCD driver enable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 	 * GPB9 output -- probably LCD VSYNC driver enable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 	 * GPB10 output -- probably LCD HSYNC driver enable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 	__raw_writel(0x00154556, S3C2410_GPBCON);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 	__raw_writel(0x00000750, S3C2410_GPBDAT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) 	__raw_writel(0x00000073, S3C2410_GPBUP);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 	/* GPC0 input RS232 DCD/DSR/RI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) 	 * GPC1 LCD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) 	 * GPC2 output RS232 DTR?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) 	 * GPC3 input RS232 DCD/DSR/RI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) 	 * GPC4 LCD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) 	 * GPC5 output 0=NAND write enabled, 1=NAND write protect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) 	 * GPC6 input -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) 	 * GPC7 input charger status 0=charger connected
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 	 *      this input can be triggered by power on the USB device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) 	 *      port too, but will go back to disconnected soon after.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) 	 * GPC8 N30/N35 output -- unknown function, always driven to 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) 	 *      PiN input -- unknown function, always read as 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) 	 *      Make it an input with a pull up for all models.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) 	 * GPC9-15 LCD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) 	__raw_writel(0xaaa80618, S3C2410_GPCCON);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) 	__raw_writel(0x0000014c, S3C2410_GPCDAT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) 	__raw_writel(0x0000fef2, S3C2410_GPCUP);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) 	/* GPD0 input -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) 	 * GPD1-D7 LCD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) 	 * GPD8 N30 output -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) 	 *      N35/PiN output 1=GPS LED on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) 	 * GPD9 output 0=power led blinks red, 1=normal power led function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) 	 * GPD10 output -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) 	 * GPD11-15 LCD drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) 	__raw_writel(0xaa95aaa4, S3C2410_GPDCON);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) 	__raw_writel(0x00000601, S3C2410_GPDDAT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) 	__raw_writel(0x0000fbfe, S3C2410_GPDUP);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) 	/* GPE0-4 I2S audio bus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) 	 * GPE5-10 SD/MMC bus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) 	 * E11-13 outputs -- unknown function, probably power management
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) 	 * E14-15 I2C bus connected to the battery controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) 	__raw_writel(0xa56aaaaa, S3C2410_GPECON);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) 	__raw_writel(0x0000efc5, S3C2410_GPEDAT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) 	__raw_writel(0x0000f81f, S3C2410_GPEUP);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) 	/* GPF0  input 0=power button pressed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) 	 * GPF1  input SD/MMC switch 0=card present
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) 	 * GPF2  N30 1=reset button pressed (inverted compared to the rest)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) 	 *	 N35/PiN 0=reset button pressed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) 	 * GPF3  N30/PiN input -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) 	 *       N35 input GPS antenna position, 0=antenna closed, 1=open
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) 	 * GPF4  input 0=button 4 pressed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) 	 * GPF5  input 0=button 3 pressed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) 	 * GPF6  input 0=button 2 pressed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) 	 * GPF7  input 0=button 1 pressed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) 	__raw_writel(0x0000aaaa, S3C2410_GPFCON);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) 	__raw_writel(0x00000000, S3C2410_GPFDAT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) 	__raw_writel(0x000000ff, S3C2410_GPFUP);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) 	/* GPG0  input RS232 DCD/DSR/RI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) 	 * GPG1  input 1=USB gadget port has power from a host
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) 	 * GPG2  N30 input -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) 	 *       N35/PiN input 0=headphones plugged in, 1=not plugged in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) 	 * GPG3  N30 output -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) 	 *       N35/PiN input with unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) 	 * GPG4  N30 output 0=MMC enabled, 1=MMC disabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) 	 * GPG5  N30 output 0=BlueTooth chip disabled, 1=enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) 	 *       N35/PiN input joystick right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) 	 * GPG6  N30 output 0=blue led on, 1=off
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) 	 *       N35/PiN input joystick left
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) 	 * GPG7  input 0=thumbwheel pressed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) 	 * GPG8  input 0=thumbwheel down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) 	 * GPG9  input 0=thumbwheel up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) 	 * GPG10 input SD/MMC write protect switch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) 	 * GPG11 N30 input -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) 	 *       N35 output 0=GPS antenna powered, 1=not powered
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) 	 *       PiN output -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) 	 * GPG12-15 touch screen functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) 	 * The pullups differ between the models, so enable all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) 	 * pullups that are enabled on any of the models.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) 	if (machine_is_n30())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) 		__raw_writel(0xff0a956a, S3C2410_GPGCON);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) 	if (machine_is_n35())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) 		__raw_writel(0xff4aa92a, S3C2410_GPGCON);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) 	__raw_writel(0x0000e800, S3C2410_GPGDAT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) 	__raw_writel(0x0000f86f, S3C2410_GPGUP);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) 	/* GPH0/1/2/3 RS232 serial port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) 	 * GPH4/5 IrDA serial port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) 	 * GPH6/7  N30 BlueTooth serial port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) 	 *         N35/PiN GPS receiver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) 	 * GPH8 input -- unknown function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) 	 * GPH9 CLKOUT0 HCLK -- unknown use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) 	 * GPH10 CLKOUT1 FCLK -- unknown use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) 	 * The pull ups for H6/H7 are enabled on N30 but not on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) 	 * N35/PiN.  I suppose is useful for a budget model of the N30
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) 	 * with no bluetooth.  It doesn't hurt to have the pull ups
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) 	 * enabled on the N35, so leave them enabled for all models.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) 	__raw_writel(0x0028aaaa, S3C2410_GPHCON);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) 	__raw_writel(0x000005ef, S3C2410_GPHDAT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) 	__raw_writel(0x0000063f, S3C2410_GPHUP);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) static void __init n30_map_io(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) 	s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) 	n30_hwinit();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) 	s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) 	s3c24xx_set_timer_source(S3C24XX_PWM3, S3C24XX_PWM4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) static void __init n30_init_time(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) 	s3c2410_init_clocks(12000000);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) 	s3c24xx_timer_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) /* GPB3 is the line that controls the pull-up for the USB D+ line */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) static void __init n30_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) 	WARN_ON(gpio_request(S3C2410_GPG(4), "mmc power"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) 	s3c24xx_fb_set_platdata(&n30_fb_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) 	s3c24xx_udc_set_platdata(&n30_udc_cfg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) 	gpiod_add_lookup_table(&n30_mci_gpio_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) 	s3c24xx_mci_set_platdata(&n30_mci_cfg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) 	s3c_i2c0_set_platdata(&n30_i2ccfg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) 	/* Turn off suspend on both USB ports, and switch the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) 	 * selectable USB port to USB device mode. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) 	s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) 			      S3C2410_MISCCR_USBSUSPND0 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) 			      S3C2410_MISCCR_USBSUSPND1, 0x0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) 	/* Configure the I2S pins (GPE0...GPE4) in correct mode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) 	s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) 			      S3C_GPIO_PULL_NONE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) 	if (machine_is_n30()) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) 		/* Turn off suspend on both USB ports, and switch the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) 		 * selectable USB port to USB device mode. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) 		s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) 				      S3C2410_MISCCR_USBSUSPND0 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) 				      S3C2410_MISCCR_USBSUSPND1, 0x0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) 		/* Disable pull-up and add GPIO tables */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) 		s3c_gpio_setpull(S3C2410_GPG(6), S3C_GPIO_PULL_NONE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) 		s3c_gpio_setpull(S3C2410_GPD(9), S3C_GPIO_PULL_NONE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) 		gpiod_add_lookup_table(&n30_blue_led_gpio_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) 		gpiod_add_lookup_table(&n30_warning_led_gpio_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) 		platform_add_devices(n30_devices, ARRAY_SIZE(n30_devices));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) 	if (machine_is_n35()) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) 		/* Turn off suspend and switch the selectable USB port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) 		 * to USB device mode.  Turn on suspend for the host
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) 		 * port since it is not connected on the N35.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) 		 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) 		 * Actually, the host port is available at some pads
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) 		 * on the back of the device, so it would actually be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) 		 * possible to add a USB device inside the N35 if you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) 		 * are willing to do some hardware modifications. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) 		s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) 				      S3C2410_MISCCR_USBSUSPND0 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641) 				      S3C2410_MISCCR_USBSUSPND1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) 				      S3C2410_MISCCR_USBSUSPND0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) 		/* Disable pull-up and add GPIO tables */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) 		s3c_gpio_setpull(S3C2410_GPD(8), S3C_GPIO_PULL_NONE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646) 		s3c_gpio_setpull(S3C2410_GPD(9), S3C_GPIO_PULL_NONE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647) 		gpiod_add_lookup_table(&n35_blue_led_gpio_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) 		gpiod_add_lookup_table(&n35_warning_led_gpio_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) 		platform_add_devices(n35_devices, ARRAY_SIZE(n35_devices));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654) MACHINE_START(N30, "Acer-N30")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655) 	/* Maintainer: Christer Weinigel <christer@weinigel.se>,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) 				Ben Dooks <ben-linux@fluff.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657) 	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658) 	.atag_offset	= 0x100,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659) 	.init_time	= n30_init_time,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660) 	.init_machine	= n30_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661) 	.init_irq	= s3c2410_init_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) 	.map_io		= n30_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663) MACHINE_END
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) MACHINE_START(N35, "Acer-N35")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666) 	/* Maintainer: Christer Weinigel <christer@weinigel.se>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) 	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) 	.atag_offset	= 0x100,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669) 	.init_time	= n30_init_time,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670) 	.init_machine	= n30_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671) 	.init_irq	= s3c2410_init_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672) 	.map_io		= n30_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) MACHINE_END