[PATCH 0/2] MFD: twl6040: Version support fixes, additions

July 16th, 2012 - 06:00 am ET by Peter Ujfalusi | Report spam
Hello,

The following series fixes the revision information for twl6040 and adds support
for twl6041.

While the first patch is changing a driver in sound/soc/codecs the series can go
via MFD since we do not have pending patches for twl6040 audio part for 3.6.

Regards,
Peter

Peter Ujfalusi (2):
MFD: twl6040: Fix revision information
MFD: twl6040: Add support for twl6041

Documentation/devicetree/bindings/mfd/twl6040.txt | 2 +-
drivers/mfd/twl6040-core.c | 1 +
include/linux/mfd/twl6040.h | 5 +++--
sound/soc/codecs/twl6040.c | 2 +-
4 files changed, 6 insertions(+), 4 deletions(-)

1.7.8.6

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
email Follow the discussionReplies 6 repliesReplies Make a reply

Similar topics

Replies

#1 Peter Ujfalusi
July 16th, 2012 - 06:00 am ET | Report spam
The delta between twl6040 and twl6041 is small, the main difference is in
the number of GPOs (3 on twl6040, 1 on twl6041).

Signed-off-by: Peter Ujfalusi

Documentation/devicetree/bindings/mfd/twl6040.txt | 2 +-
drivers/mfd/twl6040-core.c | 1 +
include/linux/mfd/twl6040.h | 1 +
3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/twl6040.txt b/Documentation/devicetree/bindings/mfd/twl6040.txt
index bc67c6f..c855240 100644
a/Documentation/devicetree/bindings/mfd/twl6040.txt
+++ b/Documentation/devicetree/bindings/mfd/twl6040.txt
@@ -6,7 +6,7 @@ They are connected ot the host processor via i2c for commands, McPDM for audio
data and commands.

Required properties:
+- compatible : "ti,twl6040" for twl6040, "ti,twl6041" for twl6041
- reg: must be 0x4b for i2c address
- interrupts: twl6040 has one interrupt line connecteded to the main SoC
- interrupt-parent: The parent interrupt controller
diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
index 4ded9e7..8b4c03b 100644
a/drivers/mfd/twl6040-core.c
+++ b/drivers/mfd/twl6040-core.c
@@ -696,6 +696,7 @@ static int __devexit twl6040_remove(struct i2c_client *client)

static const struct i2c_device_id twl6040_i2c_id[] = {
{ "twl6040", 0, },
+ { "twl6041", 0, },
{ },
};
MODULE_DEVICE_TABLE(i2c, twl6040_i2c_id);
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h
index e002097..761c99c 100644
a/include/linux/mfd/twl6040.h
+++ b/include/linux/mfd/twl6040.h
@@ -163,6 +163,7 @@
#define TWL6040_REV_ES1_0 0x00
#define TWL6040_REV_ES1_1 0x01 /* Rev ES1.1 and ES1.2 */
#define TWL6040_REV_ES1_3 0x02
+#define TWL6041_REV_ES2_0 0x10

#define TWL6040_IRQ_TH 0
#define TWL6040_IRQ_PLUG 1
1.7.8.6

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
#2 Peter Ujfalusi
July 16th, 2012 - 06:00 am ET | Report spam
twl6040 ES1.1 and ES1.2 have the same revid (0x01).
ES1.3 of twl6040 REVID is 0x02.

Signed-off-by: Peter Ujfalusi

include/linux/mfd/twl6040.h | 4 ++--
sound/soc/codecs/twl6040.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h
index 6659487..e002097 100644
a/include/linux/mfd/twl6040.h
+++ b/include/linux/mfd/twl6040.h
@@ -161,8 +161,8 @@
#define TWL6040_CELLS 2

#define TWL6040_REV_ES1_0 0x00
-#define TWL6040_REV_ES1_1 0x01
-#define TWL6040_REV_ES1_2 0x02
+#define TWL6040_REV_ES1_1 0x01 /* Rev ES1.1 and ES1.2 */
+#define TWL6040_REV_ES1_3 0x02

#define TWL6040_IRQ_TH 0
#define TWL6040_IRQ_PLUG 1
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index a36e9fc..2786de2 100644
a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -653,7 +653,7 @@ int twl6040_get_hs_step_size(struct snd_soc_codec *codec)
{
struct twl6040 *twl6040 = codec->control_data;

- if (twl6040_get_revid(twl6040) < TWL6040_REV_ES1_2)
+ if (twl6040_get_revid(twl6040) < TWL6040_REV_ES1_3)
/* For ES under ES_1.3 HS step is 2 mV */
return 2;
else
1.7.8.6

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
#3 Rajeev kumar
July 17th, 2012 - 02:50 am ET | Report spam
Hello Peter,

On 7/16/2012 3:19 PM, Peter Ujfalusi wrote:
twl6040 ES1.1 and ES1.2 have the same revid (0x01).
ES1.3 of twl6040 REVID is 0x02.

Signed-off-by: Peter Ujfalusi

include/linux/mfd/twl6040.h | 4 ++--
sound/soc/codecs/twl6040.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h
index 6659487..e002097 100644
a/include/linux/mfd/twl6040.h
+++ b/include/linux/mfd/twl6040.h
@@ -161,8 +161,8 @@
#define TWL6040_CELLS 2

#define TWL6040_REV_ES1_0 0x00
-#define TWL6040_REV_ES1_1 0x01
-#define TWL6040_REV_ES1_2 0x02
+#define TWL6040_REV_ES1_1 0x01 /* Rev ES1.1 and ES1.2 */
+#define TWL6040_REV_ES1_3 0x02

#define TWL6040_IRQ_TH 0
#define TWL6040_IRQ_PLUG 1
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index a36e9fc..2786de2 100644
a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -653,7 +653,7 @@ int twl6040_get_hs_step_size(struct snd_soc_codec *codec)
{
struct twl6040 *twl6040 = codec->control_data;

- if (twl6040_get_revid(twl6040)< TWL6040_REV_ES1_2)
+ if (twl6040_get_revid(twl6040)< TWL6040_REV_ES1_3)




Instead of doing this change why not you take a #define for revision and
do
if (twl6040_get_revid(twl6040)< TWL6040_REV)

~Rajeev

/* For ES under ES_1.3 HS step is 2 mV */
return 2;
else



To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
#4 Gabriel M. Beddingfield
July 17th, 2012 - 08:00 am ET | Report spam
On 07/17/2012 01:39 AM, Rajeev kumar wrote:
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index a36e9fc..2786de2 100644
a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -653,7 +653,7 @@ int twl6040_get_hs_step_size(struct snd_soc_codec
*codec)
{
struct twl6040 *twl6040 = codec->control_data;

- if (twl6040_get_revid(twl6040)< TWL6040_REV_ES1_2)
+ if (twl6040_get_revid(twl6040)< TWL6040_REV_ES1_3)




Instead of doing this change why not you take a #define for revision and
do
if (twl6040_get_revid(twl6040)< TWL6040_REV)



I disagree. The driver isn't just for one revision... it's for all of
them. Peter's code is pretty clear as to what the situation is. Your
suggestion hides it.

-gabriel

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
#5 Peter Ujfalusi
July 17th, 2012 - 09:10 am ET | Report spam
On 07/17/2012 08:39 AM, Rajeev kumar wrote:
#define TWL6040_REV_ES1_0 0x00
-#define TWL6040_REV_ES1_1 0x01
-#define TWL6040_REV_ES1_2 0x02
+#define TWL6040_REV_ES1_1 0x01 /* Rev ES1.1 and ES1.2 */
+#define TWL6040_REV_ES1_3 0x02

#define TWL6040_IRQ_TH 0
#define TWL6040_IRQ_PLUG 1
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index a36e9fc..2786de2 100644
a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -653,7 +653,7 @@ int twl6040_get_hs_step_size(struct snd_soc_codec *codec)
{
struct twl6040 *twl6040 = codec->control_data;

- if (twl6040_get_revid(twl6040)< TWL6040_REV_ES1_2)
+ if (twl6040_get_revid(twl6040)< TWL6040_REV_ES1_3)




Instead of doing this change why not you take a #define for revision and do
if (twl6040_get_revid(twl6040)< TWL6040_REV)



ES1.1, ES1.2 of twl6040 have 2mV HS step. Newer revisions (ES1.3 of twl6040
and twl6041) have 1mV HS step.
Here the comment was correct, but the define name was incorrect.


~Rajeev

/* For ES under ES_1.3 HS step is 2 mV */
return 2;
else







Péter


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
Help Create a new topicNext page Replies Make a reply
Search Make your own search