diff options
author | Viresh Kumar <viresh.kumar@st.com> | 2011-11-17 00:32:22 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-01-08 18:37:43 -0500 |
commit | 1cda2394e95415f1469ab8eaffd081395e112551 (patch) | |
tree | f0fa981e6e79b46b41994ec6dae6d5e777f73c0f | |
parent | e789995d5c612ecda83a9feb53fb2e42a51f685b (diff) |
mfd: Add support for stmpe variant 610
STMPE610 is very much like STMPE811, except the number of gpio pins, which is 8
in 811 and 6 in 610. This patch adds support for variant 610. STMPE610 will
share most of the code with STMPE811.
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | drivers/mfd/stmpe-i2c.c | 1 | ||||
-rw-r--r-- | drivers/mfd/stmpe-spi.c | 1 | ||||
-rw-r--r-- | drivers/mfd/stmpe.c | 20 | ||||
-rw-r--r-- | include/linux/mfd/stmpe.h | 1 |
4 files changed, 21 insertions, 2 deletions
diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c index 0a4365902e36..b11d33b1c892 100644 --- a/drivers/mfd/stmpe-i2c.c +++ b/drivers/mfd/stmpe-i2c.c | |||
@@ -71,6 +71,7 @@ static int __devexit stmpe_i2c_remove(struct i2c_client *i2c) | |||
71 | } | 71 | } |
72 | 72 | ||
73 | static const struct i2c_device_id stmpe_i2c_id[] = { | 73 | static const struct i2c_device_id stmpe_i2c_id[] = { |
74 | { "stmpe610", STMPE610 }, | ||
74 | { "stmpe811", STMPE811 }, | 75 | { "stmpe811", STMPE811 }, |
75 | { "stmpe1601", STMPE1601 }, | 76 | { "stmpe1601", STMPE1601 }, |
76 | { "stmpe2401", STMPE2401 }, | 77 | { "stmpe2401", STMPE2401 }, |
diff --git a/drivers/mfd/stmpe-spi.c b/drivers/mfd/stmpe-spi.c index 53efce4fe294..46963a5d569f 100644 --- a/drivers/mfd/stmpe-spi.c +++ b/drivers/mfd/stmpe-spi.c | |||
@@ -109,6 +109,7 @@ static int __devexit stmpe_spi_remove(struct spi_device *spi) | |||
109 | } | 109 | } |
110 | 110 | ||
111 | static const struct spi_device_id stmpe_spi_id[] = { | 111 | static const struct spi_device_id stmpe_spi_id[] = { |
112 | { "stmpe610", STMPE610 }, | ||
112 | { "stmpe811", STMPE811 }, | 113 | { "stmpe811", STMPE811 }, |
113 | { "stmpe1601", STMPE1601 }, | 114 | { "stmpe1601", STMPE1601 }, |
114 | { "stmpe2401", STMPE2401 }, | 115 | { "stmpe2401", STMPE2401 }, |
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c index 83bacde6a7cb..67ff3dc5bb45 100644 --- a/drivers/mfd/stmpe.c +++ b/drivers/mfd/stmpe.c | |||
@@ -321,7 +321,7 @@ static struct mfd_cell stmpe_keypad_cell = { | |||
321 | }; | 321 | }; |
322 | 322 | ||
323 | /* | 323 | /* |
324 | * Touchscreen (STMPE811) | 324 | * Touchscreen (STMPE811 or STMPE610) |
325 | */ | 325 | */ |
326 | 326 | ||
327 | static struct resource stmpe_ts_resources[] = { | 327 | static struct resource stmpe_ts_resources[] = { |
@@ -346,7 +346,7 @@ static struct mfd_cell stmpe_ts_cell = { | |||
346 | }; | 346 | }; |
347 | 347 | ||
348 | /* | 348 | /* |
349 | * STMPE811 | 349 | * STMPE811 or STMPE610 |
350 | */ | 350 | */ |
351 | 351 | ||
352 | static const u8 stmpe811_regs[] = { | 352 | static const u8 stmpe811_regs[] = { |
@@ -417,6 +417,21 @@ static struct stmpe_variant_info stmpe811 = { | |||
417 | .get_altfunc = stmpe811_get_altfunc, | 417 | .get_altfunc = stmpe811_get_altfunc, |
418 | }; | 418 | }; |
419 | 419 | ||
420 | /* Similar to 811, except number of gpios */ | ||
421 | static struct stmpe_variant_info stmpe610 = { | ||
422 | .name = "stmpe610", | ||
423 | .id_val = 0x0811, | ||
424 | .id_mask = 0xffff, | ||
425 | .num_gpios = 6, | ||
426 | .af_bits = 1, | ||
427 | .regs = stmpe811_regs, | ||
428 | .blocks = stmpe811_blocks, | ||
429 | .num_blocks = ARRAY_SIZE(stmpe811_blocks), | ||
430 | .num_irqs = STMPE811_NR_INTERNAL_IRQS, | ||
431 | .enable = stmpe811_enable, | ||
432 | .get_altfunc = stmpe811_get_altfunc, | ||
433 | }; | ||
434 | |||
420 | /* | 435 | /* |
421 | * STMPE1601 | 436 | * STMPE1601 |
422 | */ | 437 | */ |
@@ -651,6 +666,7 @@ static struct stmpe_variant_info stmpe2403 = { | |||
651 | }; | 666 | }; |
652 | 667 | ||
653 | static struct stmpe_variant_info *stmpe_variant_info[] = { | 668 | static struct stmpe_variant_info *stmpe_variant_info[] = { |
669 | [STMPE610] = &stmpe610, | ||
654 | [STMPE811] = &stmpe811, | 670 | [STMPE811] = &stmpe811, |
655 | [STMPE1601] = &stmpe1601, | 671 | [STMPE1601] = &stmpe1601, |
656 | [STMPE2401] = &stmpe2401, | 672 | [STMPE2401] = &stmpe2401, |
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h index babc6b2857d3..342005afd347 100644 --- a/include/linux/mfd/stmpe.h +++ b/include/linux/mfd/stmpe.h | |||
@@ -20,6 +20,7 @@ enum stmpe_block { | |||
20 | }; | 20 | }; |
21 | 21 | ||
22 | enum stmpe_partnum { | 22 | enum stmpe_partnum { |
23 | STMPE610, | ||
23 | STMPE811, | 24 | STMPE811, |
24 | STMPE1601, | 25 | STMPE1601, |
25 | STMPE2401, | 26 | STMPE2401, |