diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-07-21 10:34:00 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-07-21 10:34:00 -0400 |
commit | 1e09939bad24df95ddeeeca4fbec64fa94b66def (patch) | |
tree | 8a4661ed8c4619db28863353858e0171171b7d8a /arch/arm/plat-samsung | |
parent | 4d09a938861ef16248334d57ae250e109b0004ae (diff) | |
parent | e8de616e39ccea3b8d3cf7e68f16d216f183c4bf (diff) |
Merge branch 'next-samsung-devel' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/devel
Diffstat (limited to 'arch/arm/plat-samsung')
-rw-r--r-- | arch/arm/plat-samsung/adc.c | 84 | ||||
-rw-r--r-- | arch/arm/plat-samsung/clock.c | 98 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dev-asocdma.c | 10 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/audio.h | 1 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/clock.h | 3 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/devs.h | 6 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/fb-core.h | 15 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/fb.h | 15 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/regs-adc.h | 1 | ||||
-rw-r--r-- | arch/arm/plat-samsung/irq-uart.c | 7 | ||||
-rw-r--r-- | arch/arm/plat-samsung/pm.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-samsung/pwm-clock.c | 10 | ||||
-rw-r--r-- | arch/arm/plat-samsung/time.c | 2 |
13 files changed, 142 insertions, 112 deletions
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c index e8f2be2d67f2..ee8deef19481 100644 --- a/arch/arm/plat-samsung/adc.c +++ b/arch/arm/plat-samsung/adc.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
22 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/regulator/consumer.h> | ||
24 | 25 | ||
25 | #include <plat/regs-adc.h> | 26 | #include <plat/regs-adc.h> |
26 | #include <plat/adc.h> | 27 | #include <plat/adc.h> |
@@ -39,8 +40,9 @@ | |||
39 | */ | 40 | */ |
40 | 41 | ||
41 | enum s3c_cpu_type { | 42 | enum s3c_cpu_type { |
42 | TYPE_S3C24XX, | 43 | TYPE_ADCV1, /* S3C24XX */ |
43 | TYPE_S3C64XX | 44 | TYPE_ADCV2, /* S3C64XX, S5P64X0, S5PC100 */ |
45 | TYPE_ADCV3, /* S5PV210, S5PC110, EXYNOS4210 */ | ||
44 | }; | 46 | }; |
45 | 47 | ||
46 | struct s3c_adc_client { | 48 | struct s3c_adc_client { |
@@ -71,6 +73,7 @@ struct adc_device { | |||
71 | unsigned int prescale; | 73 | unsigned int prescale; |
72 | 74 | ||
73 | int irq; | 75 | int irq; |
76 | struct regulator *vdd; | ||
74 | }; | 77 | }; |
75 | 78 | ||
76 | static struct adc_device *adc_dev; | 79 | static struct adc_device *adc_dev; |
@@ -91,6 +94,7 @@ static inline void s3c_adc_select(struct adc_device *adc, | |||
91 | struct s3c_adc_client *client) | 94 | struct s3c_adc_client *client) |
92 | { | 95 | { |
93 | unsigned con = readl(adc->regs + S3C2410_ADCCON); | 96 | unsigned con = readl(adc->regs + S3C2410_ADCCON); |
97 | enum s3c_cpu_type cpu = platform_get_device_id(adc->pdev)->driver_data; | ||
94 | 98 | ||
95 | client->select_cb(client, 1); | 99 | client->select_cb(client, 1); |
96 | 100 | ||
@@ -98,8 +102,12 @@ static inline void s3c_adc_select(struct adc_device *adc, | |||
98 | con &= ~S3C2410_ADCCON_STDBM; | 102 | con &= ~S3C2410_ADCCON_STDBM; |
99 | con &= ~S3C2410_ADCCON_STARTMASK; | 103 | con &= ~S3C2410_ADCCON_STARTMASK; |
100 | 104 | ||
101 | if (!client->is_ts) | 105 | if (!client->is_ts) { |
102 | con |= S3C2410_ADCCON_SELMUX(client->channel); | 106 | if (cpu == TYPE_ADCV3) |
107 | writel(client->channel & 0xf, adc->regs + S5P_ADCMUX); | ||
108 | else | ||
109 | con |= S3C2410_ADCCON_SELMUX(client->channel); | ||
110 | } | ||
103 | 111 | ||
104 | writel(con, adc->regs + S3C2410_ADCCON); | 112 | writel(con, adc->regs + S3C2410_ADCCON); |
105 | } | 113 | } |
@@ -285,8 +293,8 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw) | |||
285 | 293 | ||
286 | client->nr_samples--; | 294 | client->nr_samples--; |
287 | 295 | ||
288 | if (cpu == TYPE_S3C64XX) { | 296 | if (cpu != TYPE_ADCV1) { |
289 | /* S3C64XX ADC resolution is 12-bit */ | 297 | /* S3C64XX/S5P ADC resolution is 12-bit */ |
290 | data0 &= 0xfff; | 298 | data0 &= 0xfff; |
291 | data1 &= 0xfff; | 299 | data1 &= 0xfff; |
292 | } else { | 300 | } else { |
@@ -312,7 +320,7 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw) | |||
312 | } | 320 | } |
313 | 321 | ||
314 | exit: | 322 | exit: |
315 | if (cpu == TYPE_S3C64XX) { | 323 | if (cpu != TYPE_ADCV1) { |
316 | /* Clear ADC interrupt */ | 324 | /* Clear ADC interrupt */ |
317 | writel(0, adc->regs + S3C64XX_ADCCLRINT); | 325 | writel(0, adc->regs + S3C64XX_ADCCLRINT); |
318 | } | 326 | } |
@@ -338,17 +346,24 @@ static int s3c_adc_probe(struct platform_device *pdev) | |||
338 | adc->pdev = pdev; | 346 | adc->pdev = pdev; |
339 | adc->prescale = S3C2410_ADCCON_PRSCVL(49); | 347 | adc->prescale = S3C2410_ADCCON_PRSCVL(49); |
340 | 348 | ||
349 | adc->vdd = regulator_get(dev, "vdd"); | ||
350 | if (IS_ERR(adc->vdd)) { | ||
351 | dev_err(dev, "operating without regulator \"vdd\" .\n"); | ||
352 | ret = PTR_ERR(adc->vdd); | ||
353 | goto err_alloc; | ||
354 | } | ||
355 | |||
341 | adc->irq = platform_get_irq(pdev, 1); | 356 | adc->irq = platform_get_irq(pdev, 1); |
342 | if (adc->irq <= 0) { | 357 | if (adc->irq <= 0) { |
343 | dev_err(dev, "failed to get adc irq\n"); | 358 | dev_err(dev, "failed to get adc irq\n"); |
344 | ret = -ENOENT; | 359 | ret = -ENOENT; |
345 | goto err_alloc; | 360 | goto err_reg; |
346 | } | 361 | } |
347 | 362 | ||
348 | ret = request_irq(adc->irq, s3c_adc_irq, 0, dev_name(dev), adc); | 363 | ret = request_irq(adc->irq, s3c_adc_irq, 0, dev_name(dev), adc); |
349 | if (ret < 0) { | 364 | if (ret < 0) { |
350 | dev_err(dev, "failed to attach adc irq\n"); | 365 | dev_err(dev, "failed to attach adc irq\n"); |
351 | goto err_alloc; | 366 | goto err_reg; |
352 | } | 367 | } |
353 | 368 | ||
354 | adc->clk = clk_get(dev, "adc"); | 369 | adc->clk = clk_get(dev, "adc"); |
@@ -372,10 +387,14 @@ static int s3c_adc_probe(struct platform_device *pdev) | |||
372 | goto err_clk; | 387 | goto err_clk; |
373 | } | 388 | } |
374 | 389 | ||
390 | ret = regulator_enable(adc->vdd); | ||
391 | if (ret) | ||
392 | goto err_ioremap; | ||
393 | |||
375 | clk_enable(adc->clk); | 394 | clk_enable(adc->clk); |
376 | 395 | ||
377 | tmp = adc->prescale | S3C2410_ADCCON_PRSCEN; | 396 | tmp = adc->prescale | S3C2410_ADCCON_PRSCEN; |
378 | if (platform_get_device_id(pdev)->driver_data == TYPE_S3C64XX) { | 397 | if (platform_get_device_id(pdev)->driver_data != TYPE_ADCV1) { |
379 | /* Enable 12-bit ADC resolution */ | 398 | /* Enable 12-bit ADC resolution */ |
380 | tmp |= S3C64XX_ADCCON_RESSEL; | 399 | tmp |= S3C64XX_ADCCON_RESSEL; |
381 | } | 400 | } |
@@ -388,12 +407,15 @@ static int s3c_adc_probe(struct platform_device *pdev) | |||
388 | 407 | ||
389 | return 0; | 408 | return 0; |
390 | 409 | ||
410 | err_ioremap: | ||
411 | iounmap(adc->regs); | ||
391 | err_clk: | 412 | err_clk: |
392 | clk_put(adc->clk); | 413 | clk_put(adc->clk); |
393 | 414 | ||
394 | err_irq: | 415 | err_irq: |
395 | free_irq(adc->irq, adc); | 416 | free_irq(adc->irq, adc); |
396 | 417 | err_reg: | |
418 | regulator_put(adc->vdd); | ||
397 | err_alloc: | 419 | err_alloc: |
398 | kfree(adc); | 420 | kfree(adc); |
399 | return ret; | 421 | return ret; |
@@ -406,6 +428,8 @@ static int __devexit s3c_adc_remove(struct platform_device *pdev) | |||
406 | iounmap(adc->regs); | 428 | iounmap(adc->regs); |
407 | free_irq(adc->irq, adc); | 429 | free_irq(adc->irq, adc); |
408 | clk_disable(adc->clk); | 430 | clk_disable(adc->clk); |
431 | regulator_disable(adc->vdd); | ||
432 | regulator_put(adc->vdd); | ||
409 | clk_put(adc->clk); | 433 | clk_put(adc->clk); |
410 | kfree(adc); | 434 | kfree(adc); |
411 | 435 | ||
@@ -413,8 +437,10 @@ static int __devexit s3c_adc_remove(struct platform_device *pdev) | |||
413 | } | 437 | } |
414 | 438 | ||
415 | #ifdef CONFIG_PM | 439 | #ifdef CONFIG_PM |
416 | static int s3c_adc_suspend(struct platform_device *pdev, pm_message_t state) | 440 | static int s3c_adc_suspend(struct device *dev) |
417 | { | 441 | { |
442 | struct platform_device *pdev = container_of(dev, | ||
443 | struct platform_device, dev); | ||
418 | struct adc_device *adc = platform_get_drvdata(pdev); | 444 | struct adc_device *adc = platform_get_drvdata(pdev); |
419 | unsigned long flags; | 445 | unsigned long flags; |
420 | u32 con; | 446 | u32 con; |
@@ -428,19 +454,30 @@ static int s3c_adc_suspend(struct platform_device *pdev, pm_message_t state) | |||
428 | disable_irq(adc->irq); | 454 | disable_irq(adc->irq); |
429 | spin_unlock_irqrestore(&adc->lock, flags); | 455 | spin_unlock_irqrestore(&adc->lock, flags); |
430 | clk_disable(adc->clk); | 456 | clk_disable(adc->clk); |
457 | regulator_disable(adc->vdd); | ||
431 | 458 | ||
432 | return 0; | 459 | return 0; |
433 | } | 460 | } |
434 | 461 | ||
435 | static int s3c_adc_resume(struct platform_device *pdev) | 462 | static int s3c_adc_resume(struct device *dev) |
436 | { | 463 | { |
464 | struct platform_device *pdev = container_of(dev, | ||
465 | struct platform_device, dev); | ||
437 | struct adc_device *adc = platform_get_drvdata(pdev); | 466 | struct adc_device *adc = platform_get_drvdata(pdev); |
467 | int ret; | ||
468 | unsigned long tmp; | ||
438 | 469 | ||
470 | ret = regulator_enable(adc->vdd); | ||
471 | if (ret) | ||
472 | return ret; | ||
439 | clk_enable(adc->clk); | 473 | clk_enable(adc->clk); |
440 | enable_irq(adc->irq); | 474 | enable_irq(adc->irq); |
441 | 475 | ||
442 | writel(adc->prescale | S3C2410_ADCCON_PRSCEN, | 476 | tmp = adc->prescale | S3C2410_ADCCON_PRSCEN; |
443 | adc->regs + S3C2410_ADCCON); | 477 | /* Enable 12-bit ADC resolution */ |
478 | if (platform_get_device_id(pdev)->driver_data != TYPE_ADCV1) | ||
479 | tmp |= S3C64XX_ADCCON_RESSEL; | ||
480 | writel(tmp, adc->regs + S3C2410_ADCCON); | ||
444 | 481 | ||
445 | return 0; | 482 | return 0; |
446 | } | 483 | } |
@@ -453,25 +490,32 @@ static int s3c_adc_resume(struct platform_device *pdev) | |||
453 | static struct platform_device_id s3c_adc_driver_ids[] = { | 490 | static struct platform_device_id s3c_adc_driver_ids[] = { |
454 | { | 491 | { |
455 | .name = "s3c24xx-adc", | 492 | .name = "s3c24xx-adc", |
456 | .driver_data = TYPE_S3C24XX, | 493 | .driver_data = TYPE_ADCV1, |
457 | }, { | 494 | }, { |
458 | .name = "s3c64xx-adc", | 495 | .name = "s3c64xx-adc", |
459 | .driver_data = TYPE_S3C64XX, | 496 | .driver_data = TYPE_ADCV2, |
497 | }, { | ||
498 | .name = "samsung-adc-v3", | ||
499 | .driver_data = TYPE_ADCV3, | ||
460 | }, | 500 | }, |
461 | { } | 501 | { } |
462 | }; | 502 | }; |
463 | MODULE_DEVICE_TABLE(platform, s3c_adc_driver_ids); | 503 | MODULE_DEVICE_TABLE(platform, s3c_adc_driver_ids); |
464 | 504 | ||
505 | static const struct dev_pm_ops adc_pm_ops = { | ||
506 | .suspend = s3c_adc_suspend, | ||
507 | .resume = s3c_adc_resume, | ||
508 | }; | ||
509 | |||
465 | static struct platform_driver s3c_adc_driver = { | 510 | static struct platform_driver s3c_adc_driver = { |
466 | .id_table = s3c_adc_driver_ids, | 511 | .id_table = s3c_adc_driver_ids, |
467 | .driver = { | 512 | .driver = { |
468 | .name = "s3c-adc", | 513 | .name = "s3c-adc", |
469 | .owner = THIS_MODULE, | 514 | .owner = THIS_MODULE, |
515 | .pm = &adc_pm_ops, | ||
470 | }, | 516 | }, |
471 | .probe = s3c_adc_probe, | 517 | .probe = s3c_adc_probe, |
472 | .remove = __devexit_p(s3c_adc_remove), | 518 | .remove = __devexit_p(s3c_adc_remove), |
473 | .suspend = s3c_adc_suspend, | ||
474 | .resume = s3c_adc_resume, | ||
475 | }; | 519 | }; |
476 | 520 | ||
477 | static int __init adc_init(void) | 521 | static int __init adc_init(void) |
@@ -485,4 +529,4 @@ static int __init adc_init(void) | |||
485 | return ret; | 529 | return ret; |
486 | } | 530 | } |
487 | 531 | ||
488 | arch_initcall(adc_init); | 532 | module_init(adc_init); |
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c index 772892826ffc..aecf9e90d4fc 100644 --- a/arch/arm/plat-samsung/clock.c +++ b/arch/arm/plat-samsung/clock.c | |||
@@ -71,74 +71,6 @@ static int clk_null_enable(struct clk *clk, int enable) | |||
71 | return 0; | 71 | return 0; |
72 | } | 72 | } |
73 | 73 | ||
74 | static int dev_is_s3c_uart(struct device *dev) | ||
75 | { | ||
76 | struct platform_device **pdev = s3c24xx_uart_devs; | ||
77 | int i; | ||
78 | for (i = 0; i < ARRAY_SIZE(s3c24xx_uart_devs); i++, pdev++) | ||
79 | if (*pdev && dev == &(*pdev)->dev) | ||
80 | return 1; | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | /* | ||
85 | * Serial drivers call get_clock() very early, before platform bus | ||
86 | * has been set up, this requires a special check to let them get | ||
87 | * a proper clock | ||
88 | */ | ||
89 | |||
90 | static int dev_is_platform_device(struct device *dev) | ||
91 | { | ||
92 | return dev->bus == &platform_bus_type || | ||
93 | (dev->bus == NULL && dev_is_s3c_uart(dev)); | ||
94 | } | ||
95 | |||
96 | /* Clock API calls */ | ||
97 | |||
98 | struct clk *clk_get(struct device *dev, const char *id) | ||
99 | { | ||
100 | struct clk *p; | ||
101 | struct clk *clk = ERR_PTR(-ENOENT); | ||
102 | int idno; | ||
103 | |||
104 | if (dev == NULL || !dev_is_platform_device(dev)) | ||
105 | idno = -1; | ||
106 | else | ||
107 | idno = to_platform_device(dev)->id; | ||
108 | |||
109 | spin_lock(&clocks_lock); | ||
110 | |||
111 | list_for_each_entry(p, &clocks, list) { | ||
112 | if (p->id == idno && | ||
113 | strcmp(id, p->name) == 0 && | ||
114 | try_module_get(p->owner)) { | ||
115 | clk = p; | ||
116 | break; | ||
117 | } | ||
118 | } | ||
119 | |||
120 | /* check for the case where a device was supplied, but the | ||
121 | * clock that was being searched for is not device specific */ | ||
122 | |||
123 | if (IS_ERR(clk)) { | ||
124 | list_for_each_entry(p, &clocks, list) { | ||
125 | if (p->id == -1 && strcmp(id, p->name) == 0 && | ||
126 | try_module_get(p->owner)) { | ||
127 | clk = p; | ||
128 | break; | ||
129 | } | ||
130 | } | ||
131 | } | ||
132 | |||
133 | spin_unlock(&clocks_lock); | ||
134 | return clk; | ||
135 | } | ||
136 | |||
137 | void clk_put(struct clk *clk) | ||
138 | { | ||
139 | module_put(clk->owner); | ||
140 | } | ||
141 | |||
142 | int clk_enable(struct clk *clk) | 74 | int clk_enable(struct clk *clk) |
143 | { | 75 | { |
144 | if (IS_ERR(clk) || clk == NULL) | 76 | if (IS_ERR(clk) || clk == NULL) |
@@ -241,8 +173,6 @@ int clk_set_parent(struct clk *clk, struct clk *parent) | |||
241 | return ret; | 173 | return ret; |
242 | } | 174 | } |
243 | 175 | ||
244 | EXPORT_SYMBOL(clk_get); | ||
245 | EXPORT_SYMBOL(clk_put); | ||
246 | EXPORT_SYMBOL(clk_enable); | 176 | EXPORT_SYMBOL(clk_enable); |
247 | EXPORT_SYMBOL(clk_disable); | 177 | EXPORT_SYMBOL(clk_disable); |
248 | EXPORT_SYMBOL(clk_get_rate); | 178 | EXPORT_SYMBOL(clk_get_rate); |
@@ -265,7 +195,6 @@ struct clk_ops clk_ops_def_setrate = { | |||
265 | 195 | ||
266 | struct clk clk_xtal = { | 196 | struct clk clk_xtal = { |
267 | .name = "xtal", | 197 | .name = "xtal", |
268 | .id = -1, | ||
269 | .rate = 0, | 198 | .rate = 0, |
270 | .parent = NULL, | 199 | .parent = NULL, |
271 | .ctrlbit = 0, | 200 | .ctrlbit = 0, |
@@ -273,30 +202,25 @@ struct clk clk_xtal = { | |||
273 | 202 | ||
274 | struct clk clk_ext = { | 203 | struct clk clk_ext = { |
275 | .name = "ext", | 204 | .name = "ext", |
276 | .id = -1, | ||
277 | }; | 205 | }; |
278 | 206 | ||
279 | struct clk clk_epll = { | 207 | struct clk clk_epll = { |
280 | .name = "epll", | 208 | .name = "epll", |
281 | .id = -1, | ||
282 | }; | 209 | }; |
283 | 210 | ||
284 | struct clk clk_mpll = { | 211 | struct clk clk_mpll = { |
285 | .name = "mpll", | 212 | .name = "mpll", |
286 | .id = -1, | ||
287 | .ops = &clk_ops_def_setrate, | 213 | .ops = &clk_ops_def_setrate, |
288 | }; | 214 | }; |
289 | 215 | ||
290 | struct clk clk_upll = { | 216 | struct clk clk_upll = { |
291 | .name = "upll", | 217 | .name = "upll", |
292 | .id = -1, | ||
293 | .parent = NULL, | 218 | .parent = NULL, |
294 | .ctrlbit = 0, | 219 | .ctrlbit = 0, |
295 | }; | 220 | }; |
296 | 221 | ||
297 | struct clk clk_f = { | 222 | struct clk clk_f = { |
298 | .name = "fclk", | 223 | .name = "fclk", |
299 | .id = -1, | ||
300 | .rate = 0, | 224 | .rate = 0, |
301 | .parent = &clk_mpll, | 225 | .parent = &clk_mpll, |
302 | .ctrlbit = 0, | 226 | .ctrlbit = 0, |
@@ -304,7 +228,6 @@ struct clk clk_f = { | |||
304 | 228 | ||
305 | struct clk clk_h = { | 229 | struct clk clk_h = { |
306 | .name = "hclk", | 230 | .name = "hclk", |
307 | .id = -1, | ||
308 | .rate = 0, | 231 | .rate = 0, |
309 | .parent = NULL, | 232 | .parent = NULL, |
310 | .ctrlbit = 0, | 233 | .ctrlbit = 0, |
@@ -313,7 +236,6 @@ struct clk clk_h = { | |||
313 | 236 | ||
314 | struct clk clk_p = { | 237 | struct clk clk_p = { |
315 | .name = "pclk", | 238 | .name = "pclk", |
316 | .id = -1, | ||
317 | .rate = 0, | 239 | .rate = 0, |
318 | .parent = NULL, | 240 | .parent = NULL, |
319 | .ctrlbit = 0, | 241 | .ctrlbit = 0, |
@@ -322,7 +244,6 @@ struct clk clk_p = { | |||
322 | 244 | ||
323 | struct clk clk_usb_bus = { | 245 | struct clk clk_usb_bus = { |
324 | .name = "usb-bus", | 246 | .name = "usb-bus", |
325 | .id = -1, | ||
326 | .rate = 0, | 247 | .rate = 0, |
327 | .parent = &clk_upll, | 248 | .parent = &clk_upll, |
328 | }; | 249 | }; |
@@ -330,7 +251,6 @@ struct clk clk_usb_bus = { | |||
330 | 251 | ||
331 | struct clk s3c24xx_uclk = { | 252 | struct clk s3c24xx_uclk = { |
332 | .name = "uclk", | 253 | .name = "uclk", |
333 | .id = -1, | ||
334 | }; | 254 | }; |
335 | 255 | ||
336 | /* initialise the clock system */ | 256 | /* initialise the clock system */ |
@@ -346,14 +266,11 @@ int s3c24xx_register_clock(struct clk *clk) | |||
346 | if (clk->enable == NULL) | 266 | if (clk->enable == NULL) |
347 | clk->enable = clk_null_enable; | 267 | clk->enable = clk_null_enable; |
348 | 268 | ||
349 | /* add to the list of available clocks */ | 269 | /* fill up the clk_lookup structure and register it*/ |
350 | 270 | clk->lookup.dev_id = clk->devname; | |
351 | /* Quick check to see if this clock has already been registered. */ | 271 | clk->lookup.con_id = clk->name; |
352 | BUG_ON(clk->list.prev != clk->list.next); | 272 | clk->lookup.clk = clk; |
353 | 273 | clkdev_add(&clk->lookup); | |
354 | spin_lock(&clocks_lock); | ||
355 | list_add(&clk->list, &clocks); | ||
356 | spin_unlock(&clocks_lock); | ||
357 | 274 | ||
358 | return 0; | 275 | return 0; |
359 | } | 276 | } |
@@ -463,10 +380,7 @@ static int clk_debugfs_register_one(struct clk *c) | |||
463 | char s[255]; | 380 | char s[255]; |
464 | char *p = s; | 381 | char *p = s; |
465 | 382 | ||
466 | p += sprintf(p, "%s", c->name); | 383 | p += sprintf(p, "%s", c->devname); |
467 | |||
468 | if (c->id >= 0) | ||
469 | sprintf(p, ":%d", c->id); | ||
470 | 384 | ||
471 | d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root); | 385 | d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root); |
472 | if (!d) | 386 | if (!d) |
diff --git a/arch/arm/plat-samsung/dev-asocdma.c b/arch/arm/plat-samsung/dev-asocdma.c index a068c4f42d56..97e35d3c064d 100644 --- a/arch/arm/plat-samsung/dev-asocdma.c +++ b/arch/arm/plat-samsung/dev-asocdma.c | |||
@@ -23,3 +23,13 @@ struct platform_device samsung_asoc_dma = { | |||
23 | } | 23 | } |
24 | }; | 24 | }; |
25 | EXPORT_SYMBOL(samsung_asoc_dma); | 25 | EXPORT_SYMBOL(samsung_asoc_dma); |
26 | |||
27 | struct platform_device samsung_asoc_idma = { | ||
28 | .name = "samsung-idma", | ||
29 | .id = -1, | ||
30 | .dev = { | ||
31 | .dma_mask = &audio_dmamask, | ||
32 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
33 | } | ||
34 | }; | ||
35 | EXPORT_SYMBOL(samsung_asoc_idma); | ||
diff --git a/arch/arm/plat-samsung/include/plat/audio.h b/arch/arm/plat-samsung/include/plat/audio.h index a0826ed2f9fe..aa9875f77c40 100644 --- a/arch/arm/plat-samsung/include/plat/audio.h +++ b/arch/arm/plat-samsung/include/plat/audio.h | |||
@@ -44,6 +44,7 @@ struct samsung_i2s { | |||
44 | * Also corresponds to clocks of I2SMOD[10] | 44 | * Also corresponds to clocks of I2SMOD[10] |
45 | */ | 45 | */ |
46 | const char **src_clk; | 46 | const char **src_clk; |
47 | dma_addr_t idma_addr; | ||
47 | }; | 48 | }; |
48 | 49 | ||
49 | /** | 50 | /** |
diff --git a/arch/arm/plat-samsung/include/plat/clock.h b/arch/arm/plat-samsung/include/plat/clock.h index 983c578b8276..87d5b38a86fb 100644 --- a/arch/arm/plat-samsung/include/plat/clock.h +++ b/arch/arm/plat-samsung/include/plat/clock.h | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/spinlock.h> | 12 | #include <linux/spinlock.h> |
13 | #include <linux/clkdev.h> | ||
13 | 14 | ||
14 | struct clk; | 15 | struct clk; |
15 | 16 | ||
@@ -40,6 +41,7 @@ struct clk { | |||
40 | struct module *owner; | 41 | struct module *owner; |
41 | struct clk *parent; | 42 | struct clk *parent; |
42 | const char *name; | 43 | const char *name; |
44 | const char *devname; | ||
43 | int id; | 45 | int id; |
44 | int usage; | 46 | int usage; |
45 | unsigned long rate; | 47 | unsigned long rate; |
@@ -47,6 +49,7 @@ struct clk { | |||
47 | 49 | ||
48 | struct clk_ops *ops; | 50 | struct clk_ops *ops; |
49 | int (*enable)(struct clk *, int enable); | 51 | int (*enable)(struct clk *, int enable); |
52 | struct clk_lookup lookup; | ||
50 | #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) | 53 | #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) |
51 | struct dentry *dent; /* For visible tree hierarchy */ | 54 | struct dentry *dent; /* For visible tree hierarchy */ |
52 | #endif | 55 | #endif |
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h index e3b31c26ac3e..24ebb1e1de41 100644 --- a/arch/arm/plat-samsung/include/plat/devs.h +++ b/arch/arm/plat-samsung/include/plat/devs.h | |||
@@ -40,6 +40,7 @@ extern struct platform_device s3c64xx_device_spi0; | |||
40 | extern struct platform_device s3c64xx_device_spi1; | 40 | extern struct platform_device s3c64xx_device_spi1; |
41 | 41 | ||
42 | extern struct platform_device samsung_asoc_dma; | 42 | extern struct platform_device samsung_asoc_dma; |
43 | extern struct platform_device samsung_asoc_idma; | ||
43 | 44 | ||
44 | extern struct platform_device s3c64xx_device_pcm0; | 45 | extern struct platform_device s3c64xx_device_pcm0; |
45 | extern struct platform_device s3c64xx_device_pcm1; | 46 | extern struct platform_device s3c64xx_device_pcm1; |
@@ -49,6 +50,7 @@ extern struct platform_device s3c64xx_device_ac97; | |||
49 | extern struct platform_device s3c_device_ts; | 50 | extern struct platform_device s3c_device_ts; |
50 | 51 | ||
51 | extern struct platform_device s3c_device_fb; | 52 | extern struct platform_device s3c_device_fb; |
53 | extern struct platform_device s5p_device_fimd0; | ||
52 | extern struct platform_device s3c_device_ohci; | 54 | extern struct platform_device s3c_device_ohci; |
53 | extern struct platform_device s3c_device_lcd; | 55 | extern struct platform_device s3c_device_lcd; |
54 | extern struct platform_device s3c_device_wdt; | 56 | extern struct platform_device s3c_device_wdt; |
@@ -112,6 +114,7 @@ extern struct platform_device exynos4_device_i2s2; | |||
112 | extern struct platform_device exynos4_device_spdif; | 114 | extern struct platform_device exynos4_device_spdif; |
113 | extern struct platform_device exynos4_device_pd[]; | 115 | extern struct platform_device exynos4_device_pd[]; |
114 | extern struct platform_device exynos4_device_ahci; | 116 | extern struct platform_device exynos4_device_ahci; |
117 | extern struct platform_device exynos4_device_dwmci; | ||
115 | 118 | ||
116 | extern struct platform_device s5p6440_device_pcm; | 119 | extern struct platform_device s5p6440_device_pcm; |
117 | extern struct platform_device s5p6440_device_iis; | 120 | extern struct platform_device s5p6440_device_iis; |
@@ -136,6 +139,9 @@ extern struct platform_device s5p_device_fimc1; | |||
136 | extern struct platform_device s5p_device_fimc2; | 139 | extern struct platform_device s5p_device_fimc2; |
137 | extern struct platform_device s5p_device_fimc3; | 140 | extern struct platform_device s5p_device_fimc3; |
138 | 141 | ||
142 | extern struct platform_device s5p_device_mfc; | ||
143 | extern struct platform_device s5p_device_mfc_l; | ||
144 | extern struct platform_device s5p_device_mfc_r; | ||
139 | extern struct platform_device s5p_device_mipi_csis0; | 145 | extern struct platform_device s5p_device_mipi_csis0; |
140 | extern struct platform_device s5p_device_mipi_csis1; | 146 | extern struct platform_device s5p_device_mipi_csis1; |
141 | 147 | ||
diff --git a/arch/arm/plat-samsung/include/plat/fb-core.h b/arch/arm/plat-samsung/include/plat/fb-core.h index bca383efcf6d..6abcbf139cee 100644 --- a/arch/arm/plat-samsung/include/plat/fb-core.h +++ b/arch/arm/plat-samsung/include/plat/fb-core.h | |||
@@ -26,4 +26,19 @@ static inline void s3c_fb_setname(char *name) | |||
26 | #endif | 26 | #endif |
27 | } | 27 | } |
28 | 28 | ||
29 | /* Re-define device name depending on support. */ | ||
30 | static inline void s5p_fb_setname(int id, char *name) | ||
31 | { | ||
32 | switch (id) { | ||
33 | #ifdef CONFIG_S5P_DEV_FIMD0 | ||
34 | case 0: | ||
35 | s5p_device_fimd0.name = name; | ||
36 | break; | ||
37 | #endif | ||
38 | default: | ||
39 | printk(KERN_ERR "%s: invalid device id(%d)\n", __func__, id); | ||
40 | break; | ||
41 | } | ||
42 | } | ||
43 | |||
29 | #endif /* __ASM_PLAT_FB_CORE_H */ | 44 | #endif /* __ASM_PLAT_FB_CORE_H */ |
diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h index cb3ca3adc685..01f10e4d00c7 100644 --- a/arch/arm/plat-samsung/include/plat/fb.h +++ b/arch/arm/plat-samsung/include/plat/fb.h | |||
@@ -74,6 +74,14 @@ struct s3c_fb_platdata { | |||
74 | extern void s3c_fb_set_platdata(struct s3c_fb_platdata *pd); | 74 | extern void s3c_fb_set_platdata(struct s3c_fb_platdata *pd); |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * s5p_fimd0_set_platdata() - Setup the FB device with platform data. | ||
78 | * @pd: The platform data to set. The data is copied from the passed structure | ||
79 | * so the machine data can mark the data __initdata so that any unused | ||
80 | * machines will end up dumping their data at runtime. | ||
81 | */ | ||
82 | extern void s5p_fimd0_set_platdata(struct s3c_fb_platdata *pd); | ||
83 | |||
84 | /** | ||
77 | * s3c64xx_fb_gpio_setup_24bpp() - S3C64XX setup function for 24bpp LCD | 85 | * s3c64xx_fb_gpio_setup_24bpp() - S3C64XX setup function for 24bpp LCD |
78 | * | 86 | * |
79 | * Initialise the GPIO for an 24bpp LCD display on the RGB interface. | 87 | * Initialise the GPIO for an 24bpp LCD display on the RGB interface. |
@@ -94,4 +102,11 @@ extern void s5pc100_fb_gpio_setup_24bpp(void); | |||
94 | */ | 102 | */ |
95 | extern void s5pv210_fb_gpio_setup_24bpp(void); | 103 | extern void s5pv210_fb_gpio_setup_24bpp(void); |
96 | 104 | ||
105 | /** | ||
106 | * exynos4_fimd0_gpio_setup_24bpp() - Exynos4 setup function for 24bpp LCD0 | ||
107 | * | ||
108 | * Initialise the GPIO for an 24bpp LCD display on the RGB interface 0. | ||
109 | */ | ||
110 | extern void exynos4_fimd0_gpio_setup_24bpp(void); | ||
111 | |||
97 | #endif /* __PLAT_S3C_FB_H */ | 112 | #endif /* __PLAT_S3C_FB_H */ |
diff --git a/arch/arm/plat-samsung/include/plat/regs-adc.h b/arch/arm/plat-samsung/include/plat/regs-adc.h index 7554c4fcddb9..035e8c38d69c 100644 --- a/arch/arm/plat-samsung/include/plat/regs-adc.h +++ b/arch/arm/plat-samsung/include/plat/regs-adc.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define S3C2410_ADCDAT1 S3C2410_ADCREG(0x10) | 21 | #define S3C2410_ADCDAT1 S3C2410_ADCREG(0x10) |
22 | #define S3C64XX_ADCUPDN S3C2410_ADCREG(0x14) | 22 | #define S3C64XX_ADCUPDN S3C2410_ADCREG(0x14) |
23 | #define S3C64XX_ADCCLRINT S3C2410_ADCREG(0x18) | 23 | #define S3C64XX_ADCCLRINT S3C2410_ADCREG(0x18) |
24 | #define S5P_ADCMUX S3C2410_ADCREG(0x1C) | ||
24 | #define S3C64XX_ADCCLRINTPNDNUP S3C2410_ADCREG(0x20) | 25 | #define S3C64XX_ADCCLRINTPNDNUP S3C2410_ADCREG(0x20) |
25 | 26 | ||
26 | 27 | ||
diff --git a/arch/arm/plat-samsung/irq-uart.c b/arch/arm/plat-samsung/irq-uart.c index 32582c0958e3..8960eaf8bb22 100644 --- a/arch/arm/plat-samsung/irq-uart.c +++ b/arch/arm/plat-samsung/irq-uart.c | |||
@@ -19,6 +19,8 @@ | |||
19 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | 21 | ||
22 | #include <asm/mach/irq.h> | ||
23 | |||
22 | #include <mach/map.h> | 24 | #include <mach/map.h> |
23 | #include <plat/irq-uart.h> | 25 | #include <plat/irq-uart.h> |
24 | #include <plat/regs-serial.h> | 26 | #include <plat/regs-serial.h> |
@@ -30,9 +32,12 @@ | |||
30 | static void s3c_irq_demux_uart(unsigned int irq, struct irq_desc *desc) | 32 | static void s3c_irq_demux_uart(unsigned int irq, struct irq_desc *desc) |
31 | { | 33 | { |
32 | struct s3c_uart_irq *uirq = desc->irq_data.handler_data; | 34 | struct s3c_uart_irq *uirq = desc->irq_data.handler_data; |
35 | struct irq_chip *chip = irq_get_chip(irq); | ||
33 | u32 pend = __raw_readl(uirq->regs + S3C64XX_UINTP); | 36 | u32 pend = __raw_readl(uirq->regs + S3C64XX_UINTP); |
34 | int base = uirq->base_irq; | 37 | int base = uirq->base_irq; |
35 | 38 | ||
39 | chained_irq_enter(chip, desc); | ||
40 | |||
36 | if (pend & (1 << 0)) | 41 | if (pend & (1 << 0)) |
37 | generic_handle_irq(base); | 42 | generic_handle_irq(base); |
38 | if (pend & (1 << 1)) | 43 | if (pend & (1 << 1)) |
@@ -41,6 +46,8 @@ static void s3c_irq_demux_uart(unsigned int irq, struct irq_desc *desc) | |||
41 | generic_handle_irq(base + 2); | 46 | generic_handle_irq(base + 2); |
42 | if (pend & (1 << 3)) | 47 | if (pend & (1 << 3)) |
43 | generic_handle_irq(base + 3); | 48 | generic_handle_irq(base + 3); |
49 | |||
50 | chained_irq_exit(chip, desc); | ||
44 | } | 51 | } |
45 | 52 | ||
46 | static void __init s3c_init_uart_irq(struct s3c_uart_irq *uirq) | 53 | static void __init s3c_init_uart_irq(struct s3c_uart_irq *uirq) |
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c index 5c0a440d6e16..4f9a9515beae 100644 --- a/arch/arm/plat-samsung/pm.c +++ b/arch/arm/plat-samsung/pm.c | |||
@@ -268,6 +268,7 @@ static int s3c_pm_enter(suspend_state_t state) | |||
268 | /* save all necessary core registers not covered by the drivers */ | 268 | /* save all necessary core registers not covered by the drivers */ |
269 | 269 | ||
270 | s3c_pm_save_gpios(); | 270 | s3c_pm_save_gpios(); |
271 | s3c_pm_saved_gpios(); | ||
271 | s3c_pm_save_uarts(); | 272 | s3c_pm_save_uarts(); |
272 | s3c_pm_save_core(); | 273 | s3c_pm_save_core(); |
273 | 274 | ||
@@ -309,6 +310,7 @@ static int s3c_pm_enter(suspend_state_t state) | |||
309 | s3c_pm_restore_core(); | 310 | s3c_pm_restore_core(); |
310 | s3c_pm_restore_uarts(); | 311 | s3c_pm_restore_uarts(); |
311 | s3c_pm_restore_gpios(); | 312 | s3c_pm_restore_gpios(); |
313 | s3c_pm_restored_gpios(); | ||
312 | 314 | ||
313 | s3c_pm_debug_init(); | 315 | s3c_pm_debug_init(); |
314 | 316 | ||
diff --git a/arch/arm/plat-samsung/pwm-clock.c b/arch/arm/plat-samsung/pwm-clock.c index 46c9381e083b..f1bba88ed2f5 100644 --- a/arch/arm/plat-samsung/pwm-clock.c +++ b/arch/arm/plat-samsung/pwm-clock.c | |||
@@ -268,6 +268,7 @@ static struct pwm_tdiv_clk clk_timer_tdiv[] = { | |||
268 | [0] = { | 268 | [0] = { |
269 | .clk = { | 269 | .clk = { |
270 | .name = "pwm-tdiv", | 270 | .name = "pwm-tdiv", |
271 | .devname = "s3c24xx-pwm.0", | ||
271 | .ops = &clk_tdiv_ops, | 272 | .ops = &clk_tdiv_ops, |
272 | .parent = &clk_timer_scaler[0], | 273 | .parent = &clk_timer_scaler[0], |
273 | }, | 274 | }, |
@@ -275,6 +276,7 @@ static struct pwm_tdiv_clk clk_timer_tdiv[] = { | |||
275 | [1] = { | 276 | [1] = { |
276 | .clk = { | 277 | .clk = { |
277 | .name = "pwm-tdiv", | 278 | .name = "pwm-tdiv", |
279 | .devname = "s3c24xx-pwm.1", | ||
278 | .ops = &clk_tdiv_ops, | 280 | .ops = &clk_tdiv_ops, |
279 | .parent = &clk_timer_scaler[0], | 281 | .parent = &clk_timer_scaler[0], |
280 | } | 282 | } |
@@ -282,6 +284,7 @@ static struct pwm_tdiv_clk clk_timer_tdiv[] = { | |||
282 | [2] = { | 284 | [2] = { |
283 | .clk = { | 285 | .clk = { |
284 | .name = "pwm-tdiv", | 286 | .name = "pwm-tdiv", |
287 | .devname = "s3c24xx-pwm.2", | ||
285 | .ops = &clk_tdiv_ops, | 288 | .ops = &clk_tdiv_ops, |
286 | .parent = &clk_timer_scaler[1], | 289 | .parent = &clk_timer_scaler[1], |
287 | }, | 290 | }, |
@@ -289,6 +292,7 @@ static struct pwm_tdiv_clk clk_timer_tdiv[] = { | |||
289 | [3] = { | 292 | [3] = { |
290 | .clk = { | 293 | .clk = { |
291 | .name = "pwm-tdiv", | 294 | .name = "pwm-tdiv", |
295 | .devname = "s3c24xx-pwm.3", | ||
292 | .ops = &clk_tdiv_ops, | 296 | .ops = &clk_tdiv_ops, |
293 | .parent = &clk_timer_scaler[1], | 297 | .parent = &clk_timer_scaler[1], |
294 | }, | 298 | }, |
@@ -296,6 +300,7 @@ static struct pwm_tdiv_clk clk_timer_tdiv[] = { | |||
296 | [4] = { | 300 | [4] = { |
297 | .clk = { | 301 | .clk = { |
298 | .name = "pwm-tdiv", | 302 | .name = "pwm-tdiv", |
303 | .devname = "s3c24xx-pwm.4", | ||
299 | .ops = &clk_tdiv_ops, | 304 | .ops = &clk_tdiv_ops, |
300 | .parent = &clk_timer_scaler[1], | 305 | .parent = &clk_timer_scaler[1], |
301 | }, | 306 | }, |
@@ -361,26 +366,31 @@ static struct clk_ops clk_tin_ops = { | |||
361 | static struct clk clk_tin[] = { | 366 | static struct clk clk_tin[] = { |
362 | [0] = { | 367 | [0] = { |
363 | .name = "pwm-tin", | 368 | .name = "pwm-tin", |
369 | .devname = "s3c24xx-pwm.0", | ||
364 | .id = 0, | 370 | .id = 0, |
365 | .ops = &clk_tin_ops, | 371 | .ops = &clk_tin_ops, |
366 | }, | 372 | }, |
367 | [1] = { | 373 | [1] = { |
368 | .name = "pwm-tin", | 374 | .name = "pwm-tin", |
375 | .devname = "s3c24xx-pwm.1", | ||
369 | .id = 1, | 376 | .id = 1, |
370 | .ops = &clk_tin_ops, | 377 | .ops = &clk_tin_ops, |
371 | }, | 378 | }, |
372 | [2] = { | 379 | [2] = { |
373 | .name = "pwm-tin", | 380 | .name = "pwm-tin", |
381 | .devname = "s3c24xx-pwm.2", | ||
374 | .id = 2, | 382 | .id = 2, |
375 | .ops = &clk_tin_ops, | 383 | .ops = &clk_tin_ops, |
376 | }, | 384 | }, |
377 | [3] = { | 385 | [3] = { |
378 | .name = "pwm-tin", | 386 | .name = "pwm-tin", |
387 | .devname = "s3c24xx-pwm.3", | ||
379 | .id = 3, | 388 | .id = 3, |
380 | .ops = &clk_tin_ops, | 389 | .ops = &clk_tin_ops, |
381 | }, | 390 | }, |
382 | [4] = { | 391 | [4] = { |
383 | .name = "pwm-tin", | 392 | .name = "pwm-tin", |
393 | .devname = "s3c24xx-pwm.4", | ||
384 | .id = 4, | 394 | .id = 4, |
385 | .ops = &clk_tin_ops, | 395 | .ops = &clk_tin_ops, |
386 | }, | 396 | }, |
diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c index 2231d80ad817..e3bb806bbafe 100644 --- a/arch/arm/plat-samsung/time.c +++ b/arch/arm/plat-samsung/time.c | |||
@@ -259,6 +259,8 @@ static void __init s3c2410_timer_resources(void) | |||
259 | clk_enable(timerclk); | 259 | clk_enable(timerclk); |
260 | 260 | ||
261 | if (!use_tclk1_12()) { | 261 | if (!use_tclk1_12()) { |
262 | tmpdev.id = 4; | ||
263 | tmpdev.dev.init_name = "s3c24xx-pwm.4"; | ||
262 | tin = clk_get(&tmpdev.dev, "pwm-tin"); | 264 | tin = clk_get(&tmpdev.dev, "pwm-tin"); |
263 | if (IS_ERR(tin)) | 265 | if (IS_ERR(tin)) |
264 | panic("failed to get pwm-tin clock for system timer"); | 266 | panic("failed to get pwm-tin clock for system timer"); |