diff options
author | Davide Ciminaghi <ciminaghi@gnudd.com> | 2012-11-09 09:19:55 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-11-20 06:21:15 -0500 |
commit | b18adafccd497245a6bc5b867bf9cba7e01f8729 (patch) | |
tree | 31b0f79db3f954bed9798774952e3551b5583ad5 | |
parent | 29f5b5a326b44c55e81b15308255ba695fecb323 (diff) |
mfd: sta2x11-mfd: Use defines for platform devices' names
Since there are now many sta2x11-mfd platform devices, using defines
for their names looks like a better solution.
Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | drivers/mfd/sta2x11-mfd.c | 42 | ||||
-rw-r--r-- | include/linux/mfd/sta2x11-mfd.h | 8 |
2 files changed, 30 insertions, 20 deletions
diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c index 6d12ab42aba3..8d38ef264722 100644 --- a/drivers/mfd/sta2x11-mfd.c +++ b/drivers/mfd/sta2x11-mfd.c | |||
@@ -174,9 +174,9 @@ static void sta2x11_regmap_unlock(void *__lock) | |||
174 | } | 174 | } |
175 | 175 | ||
176 | static const char *sta2x11_mfd_names[sta2x11_n_mfd_plat_devs] = { | 176 | static const char *sta2x11_mfd_names[sta2x11_n_mfd_plat_devs] = { |
177 | [sta2x11_sctl] = "sta2x11-sctl", | 177 | [sta2x11_sctl] = STA2X11_MFD_SCTL_NAME, |
178 | [sta2x11_apbreg] = "sta2x11-apbreg", | 178 | [sta2x11_apbreg] = STA2X11_MFD_APBREG_NAME, |
179 | [sta2x11_apb_soc_regs] = "sta2x11-apb-soc-regs", | 179 | [sta2x11_apb_soc_regs] = STA2X11_MFD_APB_SOC_REGS_NAME, |
180 | }; | 180 | }; |
181 | 181 | ||
182 | static bool sta2x11_sctl_writeable_reg(struct device *dev, unsigned int reg) | 182 | static bool sta2x11_sctl_writeable_reg(struct device *dev, unsigned int reg) |
@@ -340,7 +340,7 @@ static int sta2x11_apb_soc_regs_probe(struct platform_device *dev) | |||
340 | /* The three platform drivers */ | 340 | /* The three platform drivers */ |
341 | static struct platform_driver sta2x11_sctl_platform_driver = { | 341 | static struct platform_driver sta2x11_sctl_platform_driver = { |
342 | .driver = { | 342 | .driver = { |
343 | .name = "sta2x11-sctl", | 343 | .name = STA2X11_MFD_SCTL_NAME, |
344 | .owner = THIS_MODULE, | 344 | .owner = THIS_MODULE, |
345 | }, | 345 | }, |
346 | .probe = sta2x11_sctl_probe, | 346 | .probe = sta2x11_sctl_probe, |
@@ -354,7 +354,7 @@ static int __init sta2x11_sctl_init(void) | |||
354 | 354 | ||
355 | static struct platform_driver sta2x11_platform_driver = { | 355 | static struct platform_driver sta2x11_platform_driver = { |
356 | .driver = { | 356 | .driver = { |
357 | .name = "sta2x11-apbreg", | 357 | .name = STA2X11_MFD_APBREG_NAME, |
358 | .owner = THIS_MODULE, | 358 | .owner = THIS_MODULE, |
359 | }, | 359 | }, |
360 | .probe = sta2x11_apbreg_probe, | 360 | .probe = sta2x11_apbreg_probe, |
@@ -368,7 +368,7 @@ static int __init sta2x11_apbreg_init(void) | |||
368 | 368 | ||
369 | static struct platform_driver sta2x11_apb_soc_regs_platform_driver = { | 369 | static struct platform_driver sta2x11_apb_soc_regs_platform_driver = { |
370 | .driver = { | 370 | .driver = { |
371 | .name = "sta2x11-apb-soc-regs", | 371 | .name = STA2X11_MFD_APB_SOC_REGS_NAME, |
372 | .owner = THIS_MODULE, | 372 | .owner = THIS_MODULE, |
373 | }, | 373 | }, |
374 | .probe = sta2x11_apb_soc_regs_probe, | 374 | .probe = sta2x11_apb_soc_regs_probe, |
@@ -409,38 +409,40 @@ enum mfd0_bar1_cells { | |||
409 | 409 | ||
410 | static const __devinitconst struct resource gpio_resources[] = { | 410 | static const __devinitconst struct resource gpio_resources[] = { |
411 | { | 411 | { |
412 | .name = "sta2x11_gpio", /* 4 consecutive cells, 1 driver */ | 412 | /* 4 consecutive cells, 1 driver */ |
413 | .name = STA2X11_MFD_GPIO_NAME, | ||
413 | .start = 0, | 414 | .start = 0, |
414 | .end = (4 * 4096) - 1, | 415 | .end = (4 * 4096) - 1, |
415 | .flags = IORESOURCE_MEM, | 416 | .flags = IORESOURCE_MEM, |
416 | } | 417 | } |
417 | }; | 418 | }; |
418 | static const __devinitconst struct resource sctl_resources[] = { | 419 | static const __devinitconst struct resource sctl_resources[] = { |
419 | CELL_4K("sta2x11-sctl", STA2X11_SCTL), | 420 | CELL_4K(STA2X11_MFD_SCTL_NAME, STA2X11_SCTL), |
420 | }; | 421 | }; |
421 | static const __devinitconst struct resource scr_resources[] = { | 422 | static const __devinitconst struct resource scr_resources[] = { |
422 | CELL_4K("sta2x11-scr", STA2X11_SCR), | 423 | CELL_4K(STA2X11_MFD_SCR_NAME, STA2X11_SCR), |
423 | }; | 424 | }; |
424 | static const __devinitconst struct resource time_resources[] = { | 425 | static const __devinitconst struct resource time_resources[] = { |
425 | CELL_4K("sta2x11-time", STA2X11_TIME), | 426 | CELL_4K(STA2X11_MFD_TIME_NAME, STA2X11_TIME), |
426 | }; | 427 | }; |
427 | 428 | ||
428 | static const __devinitconst struct resource apbreg_resources[] = { | 429 | static const __devinitconst struct resource apbreg_resources[] = { |
429 | CELL_4K("sta2x11-apbreg", STA2X11_APBREG), | 430 | CELL_4K(STA2X11_MFD_APBREG_NAME, STA2X11_APBREG), |
430 | }; | 431 | }; |
431 | 432 | ||
432 | #define DEV(_name, _r) \ | 433 | #define DEV(_name, _r) \ |
433 | { .name = _name, .num_resources = ARRAY_SIZE(_r), .resources = _r, } | 434 | { .name = _name, .num_resources = ARRAY_SIZE(_r), .resources = _r, } |
434 | 435 | ||
435 | static __devinitdata struct mfd_cell sta2x11_mfd0_bar0[] = { | 436 | static __devinitdata struct mfd_cell sta2x11_mfd0_bar0[] = { |
436 | DEV("sta2x11-gpio", gpio_resources), /* offset 0: we add pdata later */ | 437 | /* offset 0: we add pdata later */ |
437 | DEV("sta2x11-sctl", sctl_resources), | 438 | DEV(STA2X11_MFD_GPIO_NAME, gpio_resources), |
438 | DEV("sta2x11-scr", scr_resources), | 439 | DEV(STA2X11_MFD_SCTL_NAME, sctl_resources), |
439 | DEV("sta2x11-time", time_resources), | 440 | DEV(STA2X11_MFD_SCR_NAME, scr_resources), |
441 | DEV(STA2X11_MFD_TIME_NAME, time_resources), | ||
440 | }; | 442 | }; |
441 | 443 | ||
442 | static __devinitdata struct mfd_cell sta2x11_mfd0_bar1[] = { | 444 | static __devinitdata struct mfd_cell sta2x11_mfd0_bar1[] = { |
443 | DEV("sta2x11-apbreg", apbreg_resources), | 445 | DEV(STA2X11_MFD_APBREG_NAME, apbreg_resources), |
444 | }; | 446 | }; |
445 | 447 | ||
446 | /* Mfd 1 devices */ | 448 | /* Mfd 1 devices */ |
@@ -456,19 +458,19 @@ enum mfd1_bar1_cells { | |||
456 | }; | 458 | }; |
457 | 459 | ||
458 | static const __devinitconst struct resource vic_resources[] = { | 460 | static const __devinitconst struct resource vic_resources[] = { |
459 | CELL_4K("sta2x11-vic", STA2X11_VIC), | 461 | CELL_4K(STA2X11_MFD_VIC_NAME, STA2X11_VIC), |
460 | }; | 462 | }; |
461 | 463 | ||
462 | static const __devinitconst struct resource apb_soc_regs_resources[] = { | 464 | static const __devinitconst struct resource apb_soc_regs_resources[] = { |
463 | CELL_4K("sta2x11-apb-soc-regs", STA2X11_APB_SOC_REGS), | 465 | CELL_4K(STA2X11_MFD_APB_SOC_REGS_NAME, STA2X11_APB_SOC_REGS), |
464 | }; | 466 | }; |
465 | 467 | ||
466 | static __devinitdata struct mfd_cell sta2x11_mfd1_bar0[] = { | 468 | static __devinitdata struct mfd_cell sta2x11_mfd1_bar0[] = { |
467 | DEV("sta2x11-vic", vic_resources), | 469 | DEV(STA2X11_MFD_VIC_NAME, vic_resources), |
468 | }; | 470 | }; |
469 | 471 | ||
470 | static __devinitdata struct mfd_cell sta2x11_mfd1_bar1[] = { | 472 | static __devinitdata struct mfd_cell sta2x11_mfd1_bar1[] = { |
471 | DEV("sta2x11-apb-soc-regs", apb_soc_regs_resources), | 473 | DEV(STA2X11_MFD_APB_SOC_REGS_NAME, apb_soc_regs_resources), |
472 | }; | 474 | }; |
473 | 475 | ||
474 | 476 | ||
diff --git a/include/linux/mfd/sta2x11-mfd.h b/include/linux/mfd/sta2x11-mfd.h index e813e5efbe4e..058de2bacf76 100644 --- a/include/linux/mfd/sta2x11-mfd.h +++ b/include/linux/mfd/sta2x11-mfd.h | |||
@@ -37,6 +37,14 @@ enum sta2x11_mfd_plat_dev { | |||
37 | sta2x11_n_mfd_plat_devs, | 37 | sta2x11_n_mfd_plat_devs, |
38 | }; | 38 | }; |
39 | 39 | ||
40 | #define STA2X11_MFD_SCTL_NAME "sta2x11-sctl" | ||
41 | #define STA2X11_MFD_GPIO_NAME "sta2x11-gpio" | ||
42 | #define STA2X11_MFD_SCR_NAME "sta2x11-scr" | ||
43 | #define STA2X11_MFD_TIME_NAME "sta2x11-time" | ||
44 | #define STA2X11_MFD_APBREG_NAME "sta2x11-apbreg" | ||
45 | #define STA2X11_MFD_APB_SOC_REGS_NAME "sta2x11-apb-soc-regs" | ||
46 | #define STA2X11_MFD_VIC_NAME "sta2x11-vic" | ||
47 | |||
40 | extern u32 | 48 | extern u32 |
41 | __sta2x11_mfd_mask(struct pci_dev *, u32, u32, u32, enum sta2x11_mfd_plat_dev); | 49 | __sta2x11_mfd_mask(struct pci_dev *, u32, u32, u32, enum sta2x11_mfd_plat_dev); |
42 | 50 | ||