Commit 0312e024d6cde5ef02900c4c6e2f5bb982e24af5
Committed by
Samuel Ortiz
1 parent
cd0f34b08f
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
mfd: mc13xxx: Add support for mc34708
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Marc Reilly <marc@cpdesign.com.au> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Showing 4 changed files with 33 additions and 1 deletions Side-by-side Diff
drivers/mfd/mc13xxx-core.c
... | ... | @@ -119,6 +119,11 @@ |
119 | 119 | #define MC13XXX_REVISION_FAB (0x03 << 11) |
120 | 120 | #define MC13XXX_REVISION_ICIDCODE (0x3f << 13) |
121 | 121 | |
122 | +#define MC34708_REVISION_REVMETAL (0x07 << 0) | |
123 | +#define MC34708_REVISION_REVFULL (0x07 << 3) | |
124 | +#define MC34708_REVISION_FIN (0x07 << 6) | |
125 | +#define MC34708_REVISION_FAB (0x07 << 9) | |
126 | + | |
122 | 127 | #define MC13XXX_ADC1 44 |
123 | 128 | #define MC13XXX_ADC1_ADEN (1 << 0) |
124 | 129 | #define MC13XXX_ADC1_RAND (1 << 1) |
... | ... | @@ -424,6 +429,16 @@ |
424 | 429 | maskval(revision, MC13XXX_REVISION_ICIDCODE)); |
425 | 430 | } |
426 | 431 | |
432 | +static void mc34708_print_revision(struct mc13xxx *mc13xxx, u32 revision) | |
433 | +{ | |
434 | + dev_info(mc13xxx->dev, "%s: rev %d.%d, fin: %d, fab: %d\n", | |
435 | + mc13xxx->variant->name, | |
436 | + maskval(revision, MC34708_REVISION_REVFULL), | |
437 | + maskval(revision, MC34708_REVISION_REVMETAL), | |
438 | + maskval(revision, MC34708_REVISION_FIN), | |
439 | + maskval(revision, MC34708_REVISION_FAB)); | |
440 | +} | |
441 | + | |
427 | 442 | /* These are only exported for mc13xxx-i2c and mc13xxx-spi */ |
428 | 443 | struct mc13xxx_variant mc13xxx_variant_mc13783 = { |
429 | 444 | .name = "mc13783", |
... | ... | @@ -436,6 +451,12 @@ |
436 | 451 | .print_revision = mc13xxx_print_revision, |
437 | 452 | }; |
438 | 453 | EXPORT_SYMBOL_GPL(mc13xxx_variant_mc13892); |
454 | + | |
455 | +struct mc13xxx_variant mc13xxx_variant_mc34708 = { | |
456 | + .name = "mc34708", | |
457 | + .print_revision = mc34708_print_revision, | |
458 | +}; | |
459 | +EXPORT_SYMBOL_GPL(mc13xxx_variant_mc34708); | |
439 | 460 | |
440 | 461 | static const char *mc13xxx_get_chipname(struct mc13xxx *mc13xxx) |
441 | 462 | { |
drivers/mfd/mc13xxx-i2c.c
... | ... | @@ -26,6 +26,9 @@ |
26 | 26 | .name = "mc13892", |
27 | 27 | .driver_data = (kernel_ulong_t)&mc13xxx_variant_mc13892, |
28 | 28 | }, { |
29 | + .name = "mc34708", | |
30 | + .driver_data = (kernel_ulong_t)&mc13xxx_variant_mc34708, | |
31 | + }, { | |
29 | 32 | /* sentinel */ |
30 | 33 | } |
31 | 34 | }; |
... | ... | @@ -35,6 +38,9 @@ |
35 | 38 | { |
36 | 39 | .compatible = "fsl,mc13892", |
37 | 40 | .data = &mc13xxx_variant_mc13892, |
41 | + }, { | |
42 | + .compatible = "fsl,mc34708", | |
43 | + .data = &mc13xxx_variant_mc34708, | |
38 | 44 | }, { |
39 | 45 | /* sentinel */ |
40 | 46 | } |
drivers/mfd/mc13xxx-spi.c
... | ... | @@ -33,6 +33,9 @@ |
33 | 33 | .name = "mc13892", |
34 | 34 | .driver_data = (kernel_ulong_t)&mc13xxx_variant_mc13892, |
35 | 35 | }, { |
36 | + .name = "mc34708", | |
37 | + .driver_data = (kernel_ulong_t)&mc13xxx_variant_mc34708, | |
38 | + }, { | |
36 | 39 | /* sentinel */ |
37 | 40 | } |
38 | 41 | }; |
... | ... | @@ -41,6 +44,7 @@ |
41 | 44 | static const struct of_device_id mc13xxx_dt_ids[] = { |
42 | 45 | { .compatible = "fsl,mc13783", .data = &mc13xxx_variant_mc13783, }, |
43 | 46 | { .compatible = "fsl,mc13892", .data = &mc13xxx_variant_mc13892, }, |
47 | + { .compatible = "fsl,mc34708", .data = &mc13xxx_variant_mc34708, }, | |
44 | 48 | { /* sentinel */ } |
45 | 49 | }; |
46 | 50 | MODULE_DEVICE_TABLE(of, mc13xxx_dt_ids); |
drivers/mfd/mc13xxx.h