diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-29 08:49:49 +1100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-29 08:49:49 +1100 |
commit | bb04af0e2e5bcd8d1a5d7f7d5c704f7eb328f241 (patch) | |
tree | fd67625ba9758dceff28dfca39127d7f07dae981 /arch/arm/mach-pxa/spitz.c | |
parent | 0affa456cb6da51a31a6dd76b3d8827f467f807d (diff) | |
parent | 0ff66f0c7a5f1f4f5a0d91341b6f71fd2a49f0fa (diff) | |
download | linux-3.10-bb04af0e2e5bcd8d1a5d7f7d5c704f7eb328f241.tar.gz linux-3.10-bb04af0e2e5bcd8d1a5d7f7d5c704f7eb328f241.tar.bz2 linux-3.10-bb04af0e2e5bcd8d1a5d7f7d5c704f7eb328f241.zip |
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (176 commits)
[ARM] 4795/1: S3C244X: Add armclk and setparent call
[ARM] 4794/1: S3C24XX: Comonise S3C2440 and S3C2442 clock code
[ARM] 4793/1: S3C24XX: Add IRQ->GPIO pin mapping function
[ARM] 4792/1: S3C24XX: Remove warnings from debug-macro.S
[ARM] 4791/1: S3C2412: Make fclk a parent of msysclk
[ARM] 4790/1: S3C2412: Fix parent selection for msysclk.
[ARM] 4789/1: S3C2412: Add missing CLKDIVN register values
[ARM] 4788/1: S3C24XX: Fix paramet to s3c2410_dma_ctrl if S3C2410_DMAF_AUTOSTART used.
[ARM] 4787/1: S3C24XX: s3c2410_dma_request() should return the allocated channel number
[ARM] 4786/1: S3C2412: Add SPI FIFO controll constants
[ARM] 4785/1: S3C24XX: Add _SHIFT definitions for S3C2410_BANKCON registers
[ARM] 4784/1: S3C24XX: Fix GPIO restore glitches
[ARM] 4783/1: S3C24XX: Add s3c2410_gpio_getpull()
[ARM] 4782/1: S3C24XX: Define FIQ_START for any FIQ users
[ARM] 4781/1: S3C24XX: DMA suspend and resume support
[ARM] 4780/1: S3C2412: Allow for seperate DMA channels for TX and RX
[ARM] 4779/1: S3C2412: Add s3c2412_gpio_set_sleepcfg() call
[ARM] 4778/1: S3C2412: Add armclk and init from DVS state
[ARM] 4777/1: S3C24XX: Ensure clk_set_rate() checks the set_rate method for the clk
[ARM] 4775/1: s3c2410: fix compilation error if only s3c2442 cpu is selected
...
Diffstat (limited to 'arch/arm/mach-pxa/spitz.c')
-rw-r--r-- | arch/arm/mach-pxa/spitz.c | 112 |
1 files changed, 104 insertions, 8 deletions
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 2d78199d24a..5078edeadf9 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -271,6 +271,55 @@ static struct platform_device spitzled_device = { /* * Spitz Touch Screen Device */ + +static unsigned long (*get_hsync_invperiod)(struct device *dev); + +static void inline sharpsl_wait_sync(int gpio) +{ + while((GPLR(gpio) & GPIO_bit(gpio)) == 0); + while((GPLR(gpio) & GPIO_bit(gpio)) != 0); +} + +static struct device *spitz_pxafb_dev; + +static int is_pxafb_device(struct device * dev, void * data) +{ + struct platform_device *pdev = container_of(dev, struct platform_device, dev); + + return (strncmp(pdev->name, "pxa2xx-fb", 9) == 0); +} + +static unsigned long spitz_get_hsync_invperiod(void) +{ +#ifdef CONFIG_FB_PXA + if (!spitz_pxafb_dev) { + spitz_pxafb_dev = bus_find_device(&platform_bus_type, NULL, NULL, is_pxafb_device); + if (!spitz_pxafb_dev) + return 0; + } + if (!get_hsync_invperiod) + get_hsync_invperiod = symbol_get(pxafb_get_hsync_time); + if (!get_hsync_invperiod) +#endif + return 0; + + return get_hsync_invperiod(spitz_pxafb_dev); +} + +static void spitz_put_hsync(void) +{ + put_device(spitz_pxafb_dev); + if (get_hsync_invperiod) + symbol_put(pxafb_get_hsync_time); + spitz_pxafb_dev = NULL; + get_hsync_invperiod = NULL; +} + +static void spitz_wait_hsync(void) +{ + sharpsl_wait_sync(SPITZ_GPIO_HSYNC); +} + static struct resource spitzts_resources[] = { [0] = { .start = SPITZ_IRQ_GPIO_TP_INT, @@ -280,9 +329,9 @@ static struct resource spitzts_resources[] = { }; static struct corgits_machinfo spitz_ts_machinfo = { - .get_hsync_len = spitz_get_hsync_len, - .put_hsync = spitz_put_hsync, - .wait_hsync = spitz_wait_hsync, + .get_hsync_invperiod = spitz_get_hsync_invperiod, + .put_hsync = spitz_put_hsync, + .wait_hsync = spitz_wait_hsync, }; static struct platform_device spitzts_device = { @@ -325,12 +374,10 @@ static int spitz_mci_init(struct device *dev, irq_handler_t spitz_detect_int, vo err = request_irq(SPITZ_IRQ_GPIO_nSD_DETECT, spitz_detect_int, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "MMC card detect", data); - if (err) { + if (err) printk(KERN_ERR "spitz_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); - return -1; - } - return 0; + return err; } static void spitz_mci_setpower(struct device *dev, unsigned int vdd) @@ -423,6 +470,14 @@ static struct pxaficp_platform_data spitz_ficp_platform_data = { * Spitz PXA Framebuffer */ +static void spitz_lcd_power(int on, struct fb_var_screeninfo *var) +{ + if (on) + corgi_lcdtg_hw_init(var->xres); + else + corgi_lcdtg_suspend(); +} + static struct pxafb_mode_info spitz_pxafb_modes[] = { { .pixclock = 19231, @@ -520,6 +575,27 @@ static void __init common_init(void) set_pxa_fb_info(&spitz_pxafb_info); } +#if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI) +static void spitz_bl_set_intensity(int intensity) +{ + if (intensity > 0x10) + intensity += 0x10; + + /* Bits 0-4 are accessed via the SSP interface */ + corgi_ssp_blduty_set(intensity & 0x1f); + + /* Bit 5 is via SCOOP */ + if (intensity & 0x0020) + reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_CONT); + else + set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_CONT); + + if (intensity) + set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_ON); + else + reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_BACKLIGHT_ON); +} + static void __init spitz_init(void) { platform_scoop_config = &spitz_pcmcia_config; @@ -530,6 +606,7 @@ static void __init spitz_init(void) platform_device_register(&spitzscoop2_device); } +#endif #ifdef CONFIG_MACH_AKITA /* @@ -542,6 +619,26 @@ struct platform_device akitaioexp_device = { EXPORT_SYMBOL_GPL(akitaioexp_device); +static void akita_bl_set_intensity(int intensity) +{ + if (intensity > 0x10) + intensity += 0x10; + + /* Bits 0-4 are accessed via the SSP interface */ + corgi_ssp_blduty_set(intensity & 0x1f); + + /* Bit 5 is via IO-Expander */ + if (intensity & 0x0020) + akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT); + else + akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_CONT); + + if (intensity) + akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON); + else + akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_BACKLIGHT_ON); +} + static void __init akita_init(void) { spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; @@ -558,7 +655,6 @@ static void __init akita_init(void) } #endif - static void __init fixup_spitz(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { |