Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344945
b: refs/heads/master
c: 0312e02
h: refs/heads/master
i:
  344943: dab0914
v: v3
  • Loading branch information
Uwe Kleine-König authored and Samuel Ortiz committed Nov 6, 2012
1 parent af01dfa commit 11532b4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cd0f34b08f98af72bb2f74fe4bd251558fc734d3
refs/heads/master: 0312e024d6cde5ef02900c4c6e2f5bb982e24af5
21 changes: 21 additions & 0 deletions trunk/drivers/mfd/mc13xxx-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@
#define MC13XXX_REVISION_FAB (0x03 << 11)
#define MC13XXX_REVISION_ICIDCODE (0x3f << 13)

#define MC34708_REVISION_REVMETAL (0x07 << 0)
#define MC34708_REVISION_REVFULL (0x07 << 3)
#define MC34708_REVISION_FIN (0x07 << 6)
#define MC34708_REVISION_FAB (0x07 << 9)

#define MC13XXX_ADC1 44
#define MC13XXX_ADC1_ADEN (1 << 0)
#define MC13XXX_ADC1_RAND (1 << 1)
Expand Down Expand Up @@ -424,6 +429,16 @@ static void mc13xxx_print_revision(struct mc13xxx *mc13xxx, u32 revision)
maskval(revision, MC13XXX_REVISION_ICIDCODE));
}

static void mc34708_print_revision(struct mc13xxx *mc13xxx, u32 revision)
{
dev_info(mc13xxx->dev, "%s: rev %d.%d, fin: %d, fab: %d\n",
mc13xxx->variant->name,
maskval(revision, MC34708_REVISION_REVFULL),
maskval(revision, MC34708_REVISION_REVMETAL),
maskval(revision, MC34708_REVISION_FIN),
maskval(revision, MC34708_REVISION_FAB));
}

/* These are only exported for mc13xxx-i2c and mc13xxx-spi */
struct mc13xxx_variant mc13xxx_variant_mc13783 = {
.name = "mc13783",
Expand All @@ -437,6 +452,12 @@ struct mc13xxx_variant mc13xxx_variant_mc13892 = {
};
EXPORT_SYMBOL_GPL(mc13xxx_variant_mc13892);

struct mc13xxx_variant mc13xxx_variant_mc34708 = {
.name = "mc34708",
.print_revision = mc34708_print_revision,
};
EXPORT_SYMBOL_GPL(mc13xxx_variant_mc34708);

static const char *mc13xxx_get_chipname(struct mc13xxx *mc13xxx)
{
return mc13xxx->variant->name;
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/mfd/mc13xxx-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ static const struct i2c_device_id mc13xxx_i2c_device_id[] = {
{
.name = "mc13892",
.driver_data = (kernel_ulong_t)&mc13xxx_variant_mc13892,
}, {
.name = "mc34708",
.driver_data = (kernel_ulong_t)&mc13xxx_variant_mc34708,
}, {
/* sentinel */
}
Expand All @@ -35,6 +38,9 @@ static const struct of_device_id mc13xxx_dt_ids[] = {
{
.compatible = "fsl,mc13892",
.data = &mc13xxx_variant_mc13892,
}, {
.compatible = "fsl,mc34708",
.data = &mc13xxx_variant_mc34708,
}, {
/* sentinel */
}
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/mfd/mc13xxx-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ static const struct spi_device_id mc13xxx_device_id[] = {
}, {
.name = "mc13892",
.driver_data = (kernel_ulong_t)&mc13xxx_variant_mc13892,
}, {
.name = "mc34708",
.driver_data = (kernel_ulong_t)&mc13xxx_variant_mc34708,
}, {
/* sentinel */
}
Expand All @@ -41,6 +44,7 @@ MODULE_DEVICE_TABLE(spi, mc13xxx_device_id);
static const struct of_device_id mc13xxx_dt_ids[] = {
{ .compatible = "fsl,mc13783", .data = &mc13xxx_variant_mc13783, },
{ .compatible = "fsl,mc13892", .data = &mc13xxx_variant_mc13892, },
{ .compatible = "fsl,mc34708", .data = &mc13xxx_variant_mc34708, },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, mc13xxx_dt_ids);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/mfd/mc13xxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ struct mc13xxx_variant {

extern struct mc13xxx_variant
mc13xxx_variant_mc13783,
mc13xxx_variant_mc13892;
mc13xxx_variant_mc13892,
mc13xxx_variant_mc34708;

struct mc13xxx {
struct regmap *regmap;
Expand Down

0 comments on commit 11532b4

Please sign in to comment.