Skip to content

Commit 36ec891

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (23 commits) sh: asm/gpio.h needs linux/kernel.h for might_sleep()/WARN_ON(). sh: mach-highlander: Handle SCIF pinmuxing on R7785RP. sh: sh7785 pinmux support sh: update defconfigs. sh: Kill off unused p1fc divisors from SH7763 clk fwk. sh: improve pinmux support for single direction pins sh: use 10MHz VIO_CLK for ov772x on Migo-R sh: Update gpio_set_value() pin value handling sh: update ov772x byte order on Migo-R rtc: Add R2025S/D comment to rs5c372 Kconfig entry. sh: Export cache flush routines needed by sh_eth on SH7619. sh: Wire up oops reporting in the die notifier chain. sh: ap325rxa: Kill off unused port definitions. sh: Hook up PB0->PB7 input-only pins in SH7203 PFC. sh: ap325rxa: Move off of hardcoded pinmux for flctl initialization. sh: add support FLCTL for ap325rxa board sh: gpio: Stub in dummy GPIO<->IRQ mapping routines. sh: rsk7203: leds-gpio support for RSK+ LEDs. sh: gpio: Include asm-generic/gpio.h for non-gpiolib stubs. sh: fix soc-camera compile breakage on Migo-R. ...
2 parents 70740d6 + e4b41db commit 36ec891

57 files changed

Lines changed: 7836 additions & 4045 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/sh/boards/board-ap325rxa.c‎

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/interrupt.h>
1616
#include <linux/platform_device.h>
1717
#include <linux/mtd/physmap.h>
18+
#include <linux/mtd/sh_flctl.h>
1819
#include <linux/delay.h>
1920
#include <linux/i2c.h>
2021
#include <linux/smc911x.h>
@@ -108,10 +109,45 @@ static struct platform_device ap325rxa_nor_flash_device = {
108109
},
109110
};
110111

112+
static struct mtd_partition nand_partition_info[] = {
113+
{
114+
.name = "nand_data",
115+
.offset = 0,
116+
.size = MTDPART_SIZ_FULL,
117+
},
118+
};
119+
120+
static struct resource nand_flash_resources[] = {
121+
[0] = {
122+
.start = 0xa4530000,
123+
.end = 0xa45300ff,
124+
.flags = IORESOURCE_MEM,
125+
}
126+
};
127+
128+
static struct sh_flctl_platform_data nand_flash_data = {
129+
.parts = nand_partition_info,
130+
.nr_parts = ARRAY_SIZE(nand_partition_info),
131+
.flcmncr_val = FCKSEL_E | TYPESEL_SET | NANWF_E,
132+
.has_hwecc = 1,
133+
};
134+
135+
static struct platform_device nand_flash_device = {
136+
.name = "sh_flctl",
137+
.resource = nand_flash_resources,
138+
.num_resources = ARRAY_SIZE(nand_flash_resources),
139+
.dev = {
140+
.platform_data = &nand_flash_data,
141+
},
142+
};
143+
111144
#define FPGA_LCDREG 0xB4100180
112145
#define FPGA_BKLREG 0xB4100212
113146
#define FPGA_LCDREG_VAL 0x0018
114147
#define PORT_MSELCRB 0xA4050182
148+
#define PORT_HIZCRC 0xA405015C
149+
#define PORT_DRVCRA 0xA405018A
150+
#define PORT_DRVCRB 0xA405018C
115151

116152
static void ap320_wvga_power_on(void *board_data)
117153
{
@@ -282,6 +318,7 @@ static struct platform_device *ap325rxa_devices[] __initdata = {
282318
#ifdef CONFIG_I2C
283319
&camera_device,
284320
#endif
321+
&nand_flash_device,
285322
};
286323

287324
static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
@@ -364,21 +401,36 @@ static int __init ap325rxa_devices_setup(void)
364401

365402
ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB);
366403

404+
/* FLCTL */
405+
gpio_request(GPIO_FN_FCE, NULL);
406+
gpio_request(GPIO_FN_NAF7, NULL);
407+
gpio_request(GPIO_FN_NAF6, NULL);
408+
gpio_request(GPIO_FN_NAF5, NULL);
409+
gpio_request(GPIO_FN_NAF4, NULL);
410+
gpio_request(GPIO_FN_NAF3, NULL);
411+
gpio_request(GPIO_FN_NAF2, NULL);
412+
gpio_request(GPIO_FN_NAF1, NULL);
413+
gpio_request(GPIO_FN_NAF0, NULL);
414+
gpio_request(GPIO_FN_FCDE, NULL);
415+
gpio_request(GPIO_FN_FOE, NULL);
416+
gpio_request(GPIO_FN_FSC, NULL);
417+
gpio_request(GPIO_FN_FWE, NULL);
418+
gpio_request(GPIO_FN_FRB, NULL);
419+
420+
ctrl_outw(0, PORT_HIZCRC);
421+
ctrl_outw(0xFFFF, PORT_DRVCRA);
422+
ctrl_outw(0xFFFF, PORT_DRVCRB);
423+
367424
platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20);
368425

369426
i2c_register_board_info(0, ap325rxa_i2c_devices,
370427
ARRAY_SIZE(ap325rxa_i2c_devices));
371-
428+
372429
return platform_add_devices(ap325rxa_devices,
373430
ARRAY_SIZE(ap325rxa_devices));
374431
}
375432
device_initcall(ap325rxa_devices_setup);
376433

377-
static void __init ap325rxa_setup(char **cmdline_p)
378-
{
379-
}
380-
381434
static struct sh_machine_vector mv_ap325rxa __initmv = {
382435
.mv_name = "AP-325RXA",
383-
.mv_setup = ap325rxa_setup,
384436
};

‎arch/sh/boards/board-rsk7203.c‎

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
#include <linux/mtd/map.h>
1818
#include <linux/smc911x.h>
1919
#include <linux/gpio.h>
20+
#include <linux/leds.h>
2021
#include <asm/machvec.h>
2122
#include <asm/io.h>
22-
#include <asm/sh7203.h>
23+
#include <cpu/sh7203.h>
2324

2425
static struct smc911x_platdata smc911x_info = {
2526
.flags = SMC911X_USE_16BIT,
@@ -116,10 +117,46 @@ static void __init set_mtd_partitions(void)
116117
}
117118
}
118119

120+
static struct gpio_led rsk7203_gpio_leds[] = {
121+
{
122+
.name = "green",
123+
.gpio = GPIO_PE10,
124+
.active_low = 1,
125+
}, {
126+
.name = "orange",
127+
.default_trigger = "nand-disk",
128+
.gpio = GPIO_PE12,
129+
.active_low = 1,
130+
}, {
131+
.name = "red:timer",
132+
.default_trigger = "timer",
133+
.gpio = GPIO_PC14,
134+
.active_low = 1,
135+
}, {
136+
.name = "red:heartbeat",
137+
.default_trigger = "heartbeat",
138+
.gpio = GPIO_PE11,
139+
.active_low = 1,
140+
},
141+
};
142+
143+
static struct gpio_led_platform_data rsk7203_gpio_leds_info = {
144+
.leds = rsk7203_gpio_leds,
145+
.num_leds = ARRAY_SIZE(rsk7203_gpio_leds),
146+
};
147+
148+
static struct platform_device led_device = {
149+
.name = "leds-gpio",
150+
.id = -1,
151+
.dev = {
152+
.platform_data = &rsk7203_gpio_leds_info,
153+
},
154+
};
119155

120156
static struct platform_device *rsk7203_devices[] __initdata = {
121157
&smc911x_device,
122158
&flash_device,
159+
&led_device,
123160
};
124161

125162
static int __init rsk7203_devices_setup(void)
@@ -128,11 +165,6 @@ static int __init rsk7203_devices_setup(void)
128165
gpio_request(GPIO_FN_TXD0, NULL);
129166
gpio_request(GPIO_FN_RXD0, NULL);
130167

131-
/* Lit LED0 */
132-
gpio_request(GPIO_PE10, NULL);
133-
gpio_direction_output(GPIO_PE10, 0);
134-
gpio_export(GPIO_PE10, 0);
135-
136168
set_mtd_partitions();
137169
return platform_add_devices(rsk7203_devices,
138170
ARRAY_SIZE(rsk7203_devices));

‎arch/sh/boards/mach-highlander/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ config SH_R7780MP
1818
config SH_R7785RP
1919
bool "R7785RP board support"
2020
depends on CPU_SUBTYPE_SH7785
21+
select GENERIC_GPIO
2122

2223
endchoice
2324

‎arch/sh/boards/mach-highlander/Makefile‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#
2-
# Makefile for the R7780RP-1 specific parts of the kernel
2+
# Makefile for the Highlander specific parts of the kernel
33
#
4-
irqinit-$(CONFIG_SH_R7780MP) := irq-r7780mp.o
5-
irqinit-$(CONFIG_SH_R7785RP) := irq-r7785rp.o
6-
irqinit-$(CONFIG_SH_R7780RP) := irq-r7780rp.o
7-
obj-y := setup.o $(irqinit-y)
4+
obj-y := setup.o
5+
obj-$(CONFIG_SH_R7780RP) += irq-r7780rp.o
6+
obj-$(CONFIG_SH_R7780MP) += irq-r7780mp.o
7+
obj-$(CONFIG_SH_R7785RP) += irq-r7785rp.o pinmux-r7785rp.o
88

99
ifneq ($(CONFIG_SH_R7785RP),y)
1010
obj-$(CONFIG_PUSH_SWITCH) += psw.o
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (C) 2008 Paul Mundt
3+
*
4+
* This file is subject to the terms and conditions of the GNU General Public
5+
* License. See the file "COPYING" in the main directory of this archive
6+
* for more details.
7+
*/
8+
#include <linux/init.h>
9+
#include <linux/gpio.h>
10+
#include <cpu/sh7785.h>
11+
12+
void __init highlander_plat_pinmux_setup(void)
13+
{
14+
/* SCIF0 */
15+
gpio_request(GPIO_FN_SCIF0_CTS, NULL);
16+
gpio_request(GPIO_FN_SCIF0_RTS, NULL);
17+
gpio_request(GPIO_FN_SCIF0_SCK, NULL);
18+
gpio_request(GPIO_FN_SCIF0_RXD, NULL);
19+
gpio_request(GPIO_FN_SCIF0_TXD, NULL);
20+
}

‎arch/sh/boards/mach-highlander/setup.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ static void __init highlander_setup(char **cmdline_p)
294294
(ver >> 12) & 0xf, (ver >> 8) & 0xf,
295295
(ver >> 4) & 0xf, ver & 0xf);
296296

297+
highlander_plat_pinmux_setup();
298+
297299
/*
298300
* Enable the important clocks right away..
299301
*/

‎arch/sh/boards/mach-migor/setup.c‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,11 @@ static struct clk *camera_clk;
288288

289289
static void camera_power_on(void)
290290
{
291+
/* Use 10 MHz VIO_CKO instead of 24 MHz to work
292+
* around signal quality issues on Panel Board V2.1.
293+
*/
291294
camera_clk = clk_get(NULL, "video_clk");
292-
clk_set_rate(camera_clk, 24000000);
295+
clk_set_rate(camera_clk, 10000000);
293296
clk_enable(camera_clk); /* start VIO_CKO */
294297

295298
/* use VIO_RST to take camera out of reset */
@@ -307,10 +310,18 @@ static void camera_power_off(void)
307310
gpio_set_value(GPIO_PTT3, 0);
308311
}
309312

313+
static void camera_power(int mode)
314+
{
315+
if (mode)
316+
camera_power_on();
317+
else
318+
camera_power_off();
319+
}
320+
310321
#ifdef CONFIG_I2C
311322
static unsigned char camera_ov772x_magic[] =
312323
{
313-
0x09, 0x01, 0x0c, 0x10, 0x0d, 0x41, 0x0e, 0x01,
324+
0x09, 0x01, 0x0c, 0x20, 0x0d, 0x41, 0x0e, 0x01,
314325
0x12, 0x00, 0x13, 0x8F, 0x14, 0x4A, 0x15, 0x00,
315326
0x16, 0x00, 0x17, 0x23, 0x18, 0xa0, 0x19, 0x07,
316327
0x1a, 0xf0, 0x1b, 0x40, 0x1f, 0x00, 0x20, 0x10,
@@ -386,6 +397,7 @@ static struct soc_camera_platform_info ov772x_info = {
386397
},
387398
.bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
388399
SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
400+
.power = camera_power,
389401
.set_capture = ov772x_set_capture,
390402
};
391403

@@ -400,8 +412,6 @@ static struct platform_device migor_camera_device = {
400412
static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
401413
.flags = SOCAM_MASTER | SOCAM_DATAWIDTH_8 | SOCAM_PCLK_SAMPLE_RISING \
402414
| SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH,
403-
.enable_camera = camera_power_on,
404-
.disable_camera = camera_power_off,
405415
};
406416

407417
static struct resource migor_ceu_resources[] = {

0 commit comments

Comments
 (0)