diff options
Diffstat (limited to 'arch/arm/plat-samsung')
-rw-r--r-- | arch/arm/plat-samsung/Kconfig | 6 | ||||
-rw-r--r-- | arch/arm/plat-samsung/adc.c | 24 | ||||
-rw-r--r-- | arch/arm/plat-samsung/clock.c | 20 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dev-usb-hsotg.c | 7 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/regs-adc.h | 1 |
5 files changed, 52 insertions, 6 deletions
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 1c2fe91c23e9..72da6461db12 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig @@ -132,6 +132,12 @@ config S3C_DEV_NAND help Compile in platform device definition for NAND controller +config S3C64XX_DEV_SPI + bool + help + Compile in platform device definitions for S3C64XX's type + SPI controllers. + comment "Power management" config SAMSUNG_PM_DEBUG diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c index c7659b7378b1..81caf2135721 100644 --- a/arch/arm/plat-samsung/adc.c +++ b/arch/arm/plat-samsung/adc.c @@ -262,6 +262,7 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw) { struct adc_device *adc = pw; struct s3c_adc_client *client = adc->cur; + enum s3c_cpu_type cpu = platform_get_device_id(adc->pdev)->driver_data; unsigned long flags; unsigned data0, data1; @@ -276,9 +277,17 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw) client->nr_samples--; + if (cpu == TYPE_S3C64XX) { + /* S3C64XX ADC resolution is 12-bit */ + data0 &= 0xfff; + data1 &= 0xfff; + } else { + data0 &= 0x3ff; + data1 &= 0x3ff; + } + if (client->convert_cb) - (client->convert_cb)(client, data0 & 0x3ff, data1 & 0x3ff, - &client->nr_samples); + (client->convert_cb)(client, data0, data1, &client->nr_samples); if (client->nr_samples > 0) { /* fire another conversion for this */ @@ -295,7 +304,7 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw) } exit: - if (platform_get_device_id(adc->pdev)->driver_data == TYPE_S3C64XX) { + if (cpu == TYPE_S3C64XX) { /* Clear ADC interrupt */ writel(0, adc->regs + S3C64XX_ADCCLRINT); } @@ -308,6 +317,7 @@ static int s3c_adc_probe(struct platform_device *pdev) struct adc_device *adc; struct resource *regs; int ret; + unsigned tmp; adc = kzalloc(sizeof(struct adc_device), GFP_KERNEL); if (adc == NULL) { @@ -354,8 +364,12 @@ static int s3c_adc_probe(struct platform_device *pdev) clk_enable(adc->clk); - writel(adc->prescale | S3C2410_ADCCON_PRSCEN, - adc->regs + S3C2410_ADCCON); + tmp = adc->prescale | S3C2410_ADCCON_PRSCEN; + if (platform_get_device_id(pdev)->driver_data == TYPE_S3C64XX) { + /* Enable 12-bit ADC resolution */ + tmp |= S3C64XX_ADCCON_RESSEL; + } + writel(tmp, adc->regs + S3C2410_ADCCON); dev_info(dev, "attached adc driver\n"); diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c index e9cdbe47beb6..1b25c9d8c403 100644 --- a/arch/arm/plat-samsung/clock.c +++ b/arch/arm/plat-samsung/clock.c @@ -307,6 +307,12 @@ struct clk s3c24xx_uclk = { /* initialise the clock system */ +/** + * s3c24xx_register_clock() - register a clock + * @clk: The clock to register + * + * Add the specified clock to the list of clocks known by the system. + */ int s3c24xx_register_clock(struct clk *clk) { if (clk->enable == NULL) @@ -324,13 +330,25 @@ int s3c24xx_register_clock(struct clk *clk) return 0; } +/** + * s3c24xx_register_clocks() - register an array of clock pointers + * @clks: Pointer to an array of struct clk pointers + * @nr_clks: The number of clocks in the @clks array. + * + * Call s3c24xx_register_clock() for all the clock pointers contained + * in the @clks list. Returns the number of failures. + */ int s3c24xx_register_clocks(struct clk **clks, int nr_clks) { int fails = 0; for (; nr_clks > 0; nr_clks--, clks++) { - if (s3c24xx_register_clock(*clks) < 0) + if (s3c24xx_register_clock(*clks) < 0) { + struct clk *clk = *clks; + printk(KERN_ERR "%s: failed to register %p: %s\n", + __func__, clk, clk->name); fails++; + } } return fails; diff --git a/arch/arm/plat-samsung/dev-usb-hsotg.c b/arch/arm/plat-samsung/dev-usb-hsotg.c index e2f604b51c86..33a844ab6917 100644 --- a/arch/arm/plat-samsung/dev-usb-hsotg.c +++ b/arch/arm/plat-samsung/dev-usb-hsotg.c @@ -14,6 +14,7 @@ #include <linux/kernel.h> #include <linux/string.h> #include <linux/platform_device.h> +#include <linux/dma-mapping.h> #include <mach/irqs.h> #include <mach/map.h> @@ -33,9 +34,15 @@ static struct resource s3c_usb_hsotg_resources[] = { }, }; +static u64 s3c_hsotg_dmamask = DMA_BIT_MASK(32); + struct platform_device s3c_device_usb_hsotg = { .name = "s3c-hsotg", .id = -1, .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources), .resource = s3c_usb_hsotg_resources, + .dev = { + .dma_mask = &s3c_hsotg_dmamask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, }; diff --git a/arch/arm/plat-samsung/include/plat/regs-adc.h b/arch/arm/plat-samsung/include/plat/regs-adc.h index f43c8dab39e4..7554c4fcddb9 100644 --- a/arch/arm/plat-samsung/include/plat/regs-adc.h +++ b/arch/arm/plat-samsung/include/plat/regs-adc.h @@ -25,6 +25,7 @@ /* ADCCON Register Bits */ +#define S3C64XX_ADCCON_RESSEL (1<<16) #define S3C2410_ADCCON_ECFLG (1<<15) #define S3C2410_ADCCON_PRSCEN (1<<14) #define S3C2410_ADCCON_PRSCVL(x) (((x)&0xFF)<<6) |