aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2005-09-13 04:25:33 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-13 11:22:31 -0400
commit1351e6e093271d0f5056f3ac272864cf4383041a (patch)
treebf96bf863b242529b56b7941c650b1cf0164c3be /arch/arm/mach-pxa
parent513b6e1afaf81b42cacbb24ef1aa7eea5e9661c2 (diff)
[PATCH] SharpSL: Abstract model specifics from Corgi Backlight driver
Separate out the Sharp Zaurus c7x0 series specific code from the Corgi backlight driver. Abstract model/machine specific functions to corgi_lcd.c via sharpsl.h This enables the driver to be used by the Zaurus cxx00 series. Signed-Off-by: Richard Purdie <rpurdie@rpsys.net> Cc: Vojtech Pavlik <vojtech@suse.cz> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/corgi.c6
-rw-r--r--arch/arm/mach-pxa/corgi_lcd.c65
-rw-r--r--arch/arm/mach-pxa/sharpsl.h8
3 files changed, 79 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index fc428b827671..426c2bc517eb 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -109,10 +109,16 @@ struct corgissp_machinfo corgi_ssp_machinfo = {
109/* 109/*
110 * Corgi Backlight Device 110 * Corgi Backlight Device
111 */ 111 */
112static struct corgibl_machinfo corgi_bl_machinfo = {
113 .max_intensity = 0x2f,
114 .set_bl_intensity = corgi_bl_set_intensity,
115};
116
112static struct platform_device corgibl_device = { 117static struct platform_device corgibl_device = {
113 .name = "corgi-bl", 118 .name = "corgi-bl",
114 .dev = { 119 .dev = {
115 .parent = &corgifb_device.dev, 120 .parent = &corgifb_device.dev,
121 .platform_data = &corgi_bl_machinfo,
116 }, 122 },
117 .id = -1, 123 .id = -1,
118}; 124};
diff --git a/arch/arm/mach-pxa/corgi_lcd.c b/arch/arm/mach-pxa/corgi_lcd.c
index bfe5efc11b8a..c5efcd04fcbc 100644
--- a/arch/arm/mach-pxa/corgi_lcd.c
+++ b/arch/arm/mach-pxa/corgi_lcd.c
@@ -498,3 +498,68 @@ void spitz_wait_hsync(void)
498 sharpsl_wait_sync(SPITZ_GPIO_HSYNC); 498 sharpsl_wait_sync(SPITZ_GPIO_HSYNC);
499} 499}
500#endif 500#endif
501
502/*
503 * Corgi/Spitz Backlight Power
504 */
505#ifdef CONFIG_PXA_SHARP_C7xx
506void corgi_bl_set_intensity(int intensity)
507{
508 if (intensity > 0x10)
509 intensity += 0x10;
510
511 /* Bits 0-4 are accessed via the SSP interface */
512 corgi_ssp_blduty_set(intensity & 0x1f);
513
514 /* Bit 5 is via SCOOP */
515 if (intensity & 0x0020)
516 set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_BACKLIGHT_CONT);
517 else
518 reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_BACKLIGHT_CONT);
519}
520#endif
521
522
523#if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI)
524void spitz_bl_set_intensity(int intensity)
525{
526 if (intensity > 0x10)
527 intensity += 0x10;
528
529 /* Bits 0-4 are accessed via the SSP interface */
530 corgi_ssp_blduty_set(intensity & 0x1f);
531
532 /* Bit 5 is via SCOOP */
533 if (intensity & 0x0020)
534 reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_CONT);
535 else
536 set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_CONT);
537
538 if (intensity)
539 set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_ON);
540 else
541 reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_ON);
542}
543#endif
544
545#ifdef CONFIG_MACH_AKITA
546void akita_bl_set_intensity(int intensity)
547{
548 if (intensity > 0x10)
549 intensity += 0x10;
550
551 /* Bits 0-4 are accessed via the SSP interface */
552 corgi_ssp_blduty_set(intensity & 0x1f);
553
554 /* Bit 5 is via IO-Expander */
555 if (intensity & 0x0020)
556 akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT);
557 else
558 akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT);
559
560 if (intensity)
561 akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON);
562 else
563 akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON);
564}
565#endif
diff --git a/arch/arm/mach-pxa/sharpsl.h b/arch/arm/mach-pxa/sharpsl.h
index 7007d8a1c5c5..3977a77aacdd 100644
--- a/arch/arm/mach-pxa/sharpsl.h
+++ b/arch/arm/mach-pxa/sharpsl.h
@@ -15,6 +15,14 @@ struct corgissp_machinfo {
15void corgi_ssp_set_machinfo(struct corgissp_machinfo *machinfo); 15void corgi_ssp_set_machinfo(struct corgissp_machinfo *machinfo);
16 16
17/* 17/*
18 * SharpSL Backlight
19 */
20
21void corgi_bl_set_intensity(int intensity);
22void spitz_bl_set_intensity(int intensity);
23void akita_bl_set_intensity(int intensity);
24
25/*
18 * SharpSL Touchscreen Driver 26 * SharpSL Touchscreen Driver
19 */ 27 */
20 28