Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1431580 > unrolled thread
| Started by | Florian Vaussard <florian.vaussard@gmail.com> |
|---|---|
| First post | 2016-06-26 22:30 +0200 |
| Last post | 2016-06-26 22:30 +0200 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH v2 0/4] iio: potentiometer: mcp4531: New parts, DT and typo Florian Vaussard <florian.vaussard@gmail.com> - 2016-06-26 22:30 +0200
[PATCH v2 3/4] iio: potentiometer: mcp4531: Add device tree binding Florian Vaussard <florian.vaussard@gmail.com> - 2016-06-26 22:30 +0200
Re: [PATCH v2 3/4] iio: potentiometer: mcp4531: Add device tree binding Florian Vaussard <florian.vaussard@heig-vd.ch> - 2016-06-27 08:00 +0200
Re: [PATCH v2 3/4] iio: potentiometer: mcp4531: Add device tree binding Jonathan Cameron <jic23@kernel.org> - 2016-07-03 11:30 +0200
[PATCH v2 1/4] iio: potentiometer: mcp4531: Add support for MCP454x, MCP456x, MCP464x and MCP466x Florian Vaussard <florian.vaussard@gmail.com> - 2016-06-26 22:30 +0200
| From | Florian Vaussard <florian.vaussard@gmail.com> |
|---|---|
| Date | 2016-06-26 22:30 +0200 |
| Subject | [PATCH v2 0/4] iio: potentiometer: mcp4531: New parts, DT and typo |
| Message-ID | <rOoQN-7uM-3@gated-at.bofh.it> |
Hello,
This series first adds support for parts missing from mcp4531 driver
(MCP454x, MCP456x, MCP464x and MCP466x). It then introduces the necessary
device tree binding to perform DT boot. Finally it fixes a typo in the
Kconfig.
Tested with MCP4561-103 and MCP4561-503 (DT boot).
Best regards,
Florian
---
Since v1:
- Applied Acks
- Moved the binding to i2c/trivial-devices.txt
- Fixed data pointer handling in struct of_device_id
- Renamed struct of_device_id to mcp4531_of_match
- New patch to fix typo in Kconfig
Florian Vaussard (4):
iio: potentiometer: mcp4531: Add support for MCP454x, MCP456x, MCP464x
and MCP466x
iio: potentiometer: mcp4531: Add device tree binding documentation
iio: potentiometer: mcp4531: Add device tree binding
iio: potentiometer: Fix typo in Kconfig
.../devicetree/bindings/i2c/trivial-devices.txt | 64 ++++
drivers/iio/potentiometer/Kconfig | 12 +-
drivers/iio/potentiometer/mcp4531.c | 345 ++++++++++++++++++++-
3 files changed, 415 insertions(+), 6 deletions(-)
--
2.5.5
[toc] | [next] | [standalone]
| From | Florian Vaussard <florian.vaussard@gmail.com> |
|---|---|
| Date | 2016-06-26 22:30 +0200 |
| Subject | [PATCH v2 3/4] iio: potentiometer: mcp4531: Add device tree binding |
| Message-ID | <rOoQN-7uM-13@gated-at.bofh.it> |
| In reply to | #1431580 |
This patch adds the necessary device tree binding to allow DT probing of
currently supported parts.
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
---
drivers/iio/potentiometer/mcp4531.c | 273 +++++++++++++++++++++++++++++++++++-
1 file changed, 272 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/potentiometer/mcp4531.c b/drivers/iio/potentiometer/mcp4531.c
index 2251173..bf7b853 100644
--- a/drivers/iio/potentiometer/mcp4531.c
+++ b/drivers/iio/potentiometer/mcp4531.c
@@ -31,6 +31,8 @@
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
#include <linux/iio/iio.h>
@@ -188,12 +190,275 @@ static const struct iio_info mcp4531_info = {
.driver_module = THIS_MODULE,
};
+#ifdef CONFIG_OF
+static const struct of_device_id mcp4531_of_match[] = {
+ {
+ .compatible = "microchip,mcp4531-502",
+ .data = &mcp4531_cfg[MCP453x_502]
+ },
+ {
+ .compatible = "microchip,mcp4531-103",
+ .data = &mcp4531_cfg[MCP453x_103]
+ },
+ {
+ .compatible = "microchip,mcp4531-503",
+ .data = &mcp4531_cfg[MCP453x_503]
+ },
+ {
+ .compatible = "microchip,mcp4531-104",
+ .data = &mcp4531_cfg[MCP453x_104]
+ },
+ {
+ .compatible = "microchip,mcp4532-502",
+ .data = &mcp4531_cfg[MCP453x_502]
+ },
+ {
+ .compatible = "microchip,mcp4532-103",
+ .data = &mcp4531_cfg[MCP453x_103]
+ },
+ {
+ .compatible = "microchip,mcp4532-503",
+ .data = &mcp4531_cfg[MCP453x_503]
+ },
+ {
+ .compatible = "microchip,mcp4532-104",
+ .data = &mcp4531_cfg[MCP453x_104]
+ },
+ {
+ .compatible = "microchip,mcp4541-502",
+ .data = &mcp4531_cfg[MCP454x_502]
+ },
+ {
+ .compatible = "microchip,mcp4541-103",
+ .data = &mcp4531_cfg[MCP454x_103]
+ },
+ {
+ .compatible = "microchip,mcp4541-503",
+ .data = &mcp4531_cfg[MCP454x_503]
+ },
+ {
+ .compatible = "microchip,mcp4541-104",
+ .data = &mcp4531_cfg[MCP454x_104]
+ },
+ {
+ .compatible = "microchip,mcp4542-502",
+ .data = &mcp4531_cfg[MCP454x_502]
+ },
+ {
+ .compatible = "microchip,mcp4542-103",
+ .data = &mcp4531_cfg[MCP454x_103]
+ },
+ {
+ .compatible = "microchip,mcp4542-503",
+ .data = &mcp4531_cfg[MCP454x_503]
+ },
+ {
+ .compatible = "microchip,mcp4542-104",
+ .data = &mcp4531_cfg[MCP454x_104]
+ },
+ {
+ .compatible = "microchip,mcp4551-502",
+ .data = &mcp4531_cfg[MCP455x_502]
+ },
+ {
+ .compatible = "microchip,mcp4551-103",
+ .data = &mcp4531_cfg[MCP455x_103]
+ },
+ {
+ .compatible = "microchip,mcp4551-503",
+ .data = &mcp4531_cfg[MCP455x_503]
+ },
+ {
+ .compatible = "microchip,mcp4551-104",
+ .data = &mcp4531_cfg[MCP455x_104]
+ },
+ {
+ .compatible = "microchip,mcp4552-502",
+ .data = &mcp4531_cfg[MCP455x_502]
+ },
+ {
+ .compatible = "microchip,mcp4552-103",
+ .data = &mcp4531_cfg[MCP455x_103]
+ },
+ {
+ .compatible = "microchip,mcp4552-503",
+ .data = &mcp4531_cfg[MCP455x_503]
+ },
+ {
+ .compatible = "microchip,mcp4552-104",
+ .data = &mcp4531_cfg[MCP455x_104]
+ },
+ {
+ .compatible = "microchip,mcp4561-502",
+ .data = &mcp4531_cfg[MCP456x_502]
+ },
+ {
+ .compatible = "microchip,mcp4561-103",
+ .data = &mcp4531_cfg[MCP456x_103]
+ },
+ {
+ .compatible = "microchip,mcp4561-503",
+ .data = &mcp4531_cfg[MCP456x_503]
+ },
+ {
+ .compatible = "microchip,mcp4561-104",
+ .data = &mcp4531_cfg[MCP456x_104]
+ },
+ {
+ .compatible = "microchip,mcp4562-502",
+ .data = &mcp4531_cfg[MCP456x_502]
+ },
+ {
+ .compatible = "microchip,mcp4562-103",
+ .data = &mcp4531_cfg[MCP456x_103]
+ },
+ {
+ .compatible = "microchip,mcp4562-503",
+ .data = &mcp4531_cfg[MCP456x_503]
+ },
+ {
+ .compatible = "microchip,mcp4562-104",
+ .data = &mcp4531_cfg[MCP456x_104]
+ },
+ {
+ .compatible = "microchip,mcp4631-502",
+ .data = &mcp4531_cfg[MCP463x_502]
+ },
+ {
+ .compatible = "microchip,mcp4631-103",
+ .data = &mcp4531_cfg[MCP463x_103]
+ },
+ {
+ .compatible = "microchip,mcp4631-503",
+ .data = &mcp4531_cfg[MCP463x_503]
+ },
+ {
+ .compatible = "microchip,mcp4631-104",
+ .data = &mcp4531_cfg[MCP463x_104]
+ },
+ {
+ .compatible = "microchip,mcp4632-502",
+ .data = &mcp4531_cfg[MCP463x_502]
+ },
+ {
+ .compatible = "microchip,mcp4632-103",
+ .data = &mcp4531_cfg[MCP463x_103]
+ },
+ {
+ .compatible = "microchip,mcp4632-503",
+ .data = &mcp4531_cfg[MCP463x_503]
+ },
+ {
+ .compatible = "microchip,mcp4632-104",
+ .data = &mcp4531_cfg[MCP463x_104]
+ },
+ {
+ .compatible = "microchip,mcp4641-502",
+ .data = &mcp4531_cfg[MCP464x_502]
+ },
+ {
+ .compatible = "microchip,mcp4641-103",
+ .data = &mcp4531_cfg[MCP464x_103]
+ },
+ {
+ .compatible = "microchip,mcp4641-503",
+ .data = &mcp4531_cfg[MCP464x_503]
+ },
+ {
+ .compatible = "microchip,mcp4641-104",
+ .data = &mcp4531_cfg[MCP464x_104]
+ },
+ {
+ .compatible = "microchip,mcp4642-502",
+ .data = &mcp4531_cfg[MCP464x_502]
+ },
+ {
+ .compatible = "microchip,mcp4642-103",
+ .data = &mcp4531_cfg[MCP464x_103]
+ },
+ {
+ .compatible = "microchip,mcp4642-503",
+ .data = &mcp4531_cfg[MCP464x_503]
+ },
+ {
+ .compatible = "microchip,mcp4642-104",
+ .data = &mcp4531_cfg[MCP464x_104]
+ },
+ {
+ .compatible = "microchip,mcp4651-502",
+ .data = &mcp4531_cfg[MCP465x_502]
+ },
+ {
+ .compatible = "microchip,mcp4651-103",
+ .data = &mcp4531_cfg[MCP465x_103]
+ },
+ {
+ .compatible = "microchip,mcp4651-503",
+ .data = &mcp4531_cfg[MCP465x_503]
+ },
+ {
+ .compatible = "microchip,mcp4651-104",
+ .data = &mcp4531_cfg[MCP465x_104]
+ },
+ {
+ .compatible = "microchip,mcp4652-502",
+ .data = &mcp4531_cfg[MCP465x_502]
+ },
+ {
+ .compatible = "microchip,mcp4652-103",
+ .data = &mcp4531_cfg[MCP465x_103]
+ },
+ {
+ .compatible = "microchip,mcp4652-503",
+ .data = &mcp4531_cfg[MCP465x_503]
+ },
+ {
+ .compatible = "microchip,mcp4652-104",
+ .data = &mcp4531_cfg[MCP465x_104]
+ },
+ {
+ .compatible = "microchip,mcp4661-502",
+ .data = &mcp4531_cfg[MCP466x_502]
+ },
+ {
+ .compatible = "microchip,mcp4661-103",
+ .data = &mcp4531_cfg[MCP466x_103]
+ },
+ {
+ .compatible = "microchip,mcp4661-503",
+ .data = &mcp4531_cfg[MCP466x_503]
+ },
+ {
+ .compatible = "microchip,mcp4661-104",
+ .data = &mcp4531_cfg[MCP466x_104]
+ },
+ {
+ .compatible = "microchip,mcp4662-502",
+ .data = &mcp4531_cfg[MCP466x_502]
+ },
+ {
+ .compatible = "microchip,mcp4662-103",
+ .data = &mcp4531_cfg[MCP466x_103]
+ },
+ {
+ .compatible = "microchip,mcp4662-503",
+ .data = &mcp4531_cfg[MCP466x_503]
+ },
+ {
+ .compatible = "microchip,mcp4662-104",
+ .data = &mcp4531_cfg[MCP466x_104]
+ },
+ { /* sentinel */ }
+};
+#endif
+
static int mcp4531_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct device *dev = &client->dev;
struct mcp4531_data *data;
struct iio_dev *indio_dev;
+ const struct of_device_id *match;
if (!i2c_check_functionality(client->adapter,
I2C_FUNC_SMBUS_WORD_DATA)) {
@@ -207,7 +472,12 @@ static int mcp4531_probe(struct i2c_client *client,
data = iio_priv(indio_dev);
i2c_set_clientdata(client, indio_dev);
data->client = client;
- data->cfg = &mcp4531_cfg[id->driver_data];
+
+ match = of_match_device(of_match_ptr(mcp4531_of_match), dev);
+ if (match)
+ data->cfg = of_device_get_match_data(dev);
+ else
+ data->cfg = &mcp4531_cfg[id->driver_data];
indio_dev->dev.parent = dev;
indio_dev->info = &mcp4531_info;
@@ -290,6 +560,7 @@ MODULE_DEVICE_TABLE(i2c, mcp4531_id);
static struct i2c_driver mcp4531_driver = {
.driver = {
.name = "mcp4531",
+ .of_match_table = of_match_ptr(mcp4531_of_match),
},
.probe = mcp4531_probe,
.id_table = mcp4531_id,
--
2.5.5
[toc] | [prev] | [next] | [standalone]
| From | Florian Vaussard <florian.vaussard@heig-vd.ch> |
|---|---|
| Date | 2016-06-27 08:00 +0200 |
| Subject | Re: [PATCH v2 3/4] iio: potentiometer: mcp4531: Add device tree binding |
| Message-ID | <rOxKq-4Aw-17@gated-at.bofh.it> |
| In reply to | #1431581 |
Hi Peter,
Le 27. 06. 16 à 00:12, Peter Rosin a écrit :
> Hi Florian,
>
> On 2016-06-26 22:22, Florian Vaussard wrote:
>> This patch adds the necessary device tree binding to allow DT probing of
>> currently supported parts.
>>
>> Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
>> ---
>> drivers/iio/potentiometer/mcp4531.c | 273 +++++++++++++++++++++++++++++++++++-
>> 1 file changed, 272 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/iio/potentiometer/mcp4531.c b/drivers/iio/potentiometer/mcp4531.c
>> index 2251173..bf7b853 100644
>> --- a/drivers/iio/potentiometer/mcp4531.c
>> +++ b/drivers/iio/potentiometer/mcp4531.c
>> @@ -31,6 +31,8 @@
>> #include <linux/module.h>
>> #include <linux/i2c.h>
>> #include <linux/err.h>
>> +#include <linux/of.h>
>> +#include <linux/of_device.h>
>>
>> #include <linux/iio/iio.h>
>>
>> @@ -188,12 +190,275 @@ static const struct iio_info mcp4531_info = {
>> .driver_module = THIS_MODULE,
>> };
>>
>> +#ifdef CONFIG_OF
>> +static const struct of_device_id mcp4531_of_match[] = {
>> + {
>> + .compatible = "microchip,mcp4531-502",
>> + .data = &mcp4531_cfg[MCP453x_502]
>> + },
>
> All this vertical whitespace makes this unreadable. I'd be
> happier with either ignoring the 80 char rule, or skipping
> the leading tab. I.e.
>
> { .compatible = "microchip,mcp4531-502", .data = &mcp4531_cfg[MCP453x_502] },
> { .compatible = "microchip,mcp4531-103", .data = &mcp4531_cfg[MCP453x_103] },
> { .compatible = "microchip,mcp4531-503", .data = &mcp4531_cfg[MCP453x_503] },
> ...
>
> or
>
> { .compatible = "microchip,mcp4531-502", .data = &mcp4531_cfg[MCP453x_502] },
> { .compatible = "microchip,mcp4531-103", .data = &mcp4531_cfg[MCP453x_103] },
> { .compatible = "microchip,mcp4531-503", .data = &mcp4531_cfg[MCP453x_503] },
> ...
>
> Or perhaps using a macro?
>
> #define MCP4531_COMPATIBLE(of_compatible, cfg) { \
> .compatible = of_compatible, \
> .data = &mcp4531_cfg[cfg], \
> }
>
> and then
>
> MCP4531_COMPATIBLE("microchip,mcp4531-502", MCP453x_502),
> MCP4531_COMPATIBLE("microchip,mcp4531-103", MCP453x_103),
> MCP4531_COMPATIBLE("microchip,mcp4531-503", MCP453x_503),
> ...
>
> Pick any of those, and you have my ack. Maybe Jonathan has an opinion
> on which is best?
>
The macro is my preferred one, as it makes things easier to read. Jonathan?
Thanks for the suggestion!
Best,
Florian
[toc] | [prev] | [next] | [standalone]
| From | Jonathan Cameron <jic23@kernel.org> |
|---|---|
| Date | 2016-07-03 11:30 +0200 |
| Subject | Re: [PATCH v2 3/4] iio: potentiometer: mcp4531: Add device tree binding |
| Message-ID | <rQLSV-6X4-3@gated-at.bofh.it> |
| In reply to | #1431731 |
On 27/06/16 06:30, Florian Vaussard wrote:
> Hi Peter,
>
> Le 27. 06. 16 à 00:12, Peter Rosin a écrit :
>> Hi Florian,
>>
>> On 2016-06-26 22:22, Florian Vaussard wrote:
>>> This patch adds the necessary device tree binding to allow DT probing of
>>> currently supported parts.
>>>
>>> Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
>>> ---
>>> drivers/iio/potentiometer/mcp4531.c | 273 +++++++++++++++++++++++++++++++++++-
>>> 1 file changed, 272 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/iio/potentiometer/mcp4531.c b/drivers/iio/potentiometer/mcp4531.c
>>> index 2251173..bf7b853 100644
>>> --- a/drivers/iio/potentiometer/mcp4531.c
>>> +++ b/drivers/iio/potentiometer/mcp4531.c
>>> @@ -31,6 +31,8 @@
>>> #include <linux/module.h>
>>> #include <linux/i2c.h>
>>> #include <linux/err.h>
>>> +#include <linux/of.h>
>>> +#include <linux/of_device.h>
>>>
>>> #include <linux/iio/iio.h>
>>>
>>> @@ -188,12 +190,275 @@ static const struct iio_info mcp4531_info = {
>>> .driver_module = THIS_MODULE,
>>> };
>>>
>>> +#ifdef CONFIG_OF
>>> +static const struct of_device_id mcp4531_of_match[] = {
>>> + {
>>> + .compatible = "microchip,mcp4531-502",
>>> + .data = &mcp4531_cfg[MCP453x_502]
>>> + },
>>
>> All this vertical whitespace makes this unreadable. I'd be
>> happier with either ignoring the 80 char rule, or skipping
>> the leading tab. I.e.
>>
>> { .compatible = "microchip,mcp4531-502", .data = &mcp4531_cfg[MCP453x_502] },
>> { .compatible = "microchip,mcp4531-103", .data = &mcp4531_cfg[MCP453x_103] },
>> { .compatible = "microchip,mcp4531-503", .data = &mcp4531_cfg[MCP453x_503] },
>> ...
>>
>> or
>>
>> { .compatible = "microchip,mcp4531-502", .data = &mcp4531_cfg[MCP453x_502] },
>> { .compatible = "microchip,mcp4531-103", .data = &mcp4531_cfg[MCP453x_103] },
>> { .compatible = "microchip,mcp4531-503", .data = &mcp4531_cfg[MCP453x_503] },
>> ...
>>
>> Or perhaps using a macro?
>>
>> #define MCP4531_COMPATIBLE(of_compatible, cfg) { \
>> .compatible = of_compatible, \
>> .data = &mcp4531_cfg[cfg], \
>> }
>>
>> and then
>>
>> MCP4531_COMPATIBLE("microchip,mcp4531-502", MCP453x_502),
>> MCP4531_COMPATIBLE("microchip,mcp4531-103", MCP453x_103),
>> MCP4531_COMPATIBLE("microchip,mcp4531-503", MCP453x_503),
>> ...
>>
>> Pick any of those, and you have my ack. Maybe Jonathan has an opinion
>> on which is best?
>>
>
> The macro is my preferred one, as it makes things easier to read. Jonathan?
I'm fine with any of the options (or indeed the original line break heavy
approach). Take your pick!
Jonathan
>
> Thanks for the suggestion!
>
> Best,
> Florian
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
[toc] | [prev] | [next] | [standalone]
| From | Florian Vaussard <florian.vaussard@gmail.com> |
|---|---|
| Date | 2016-06-26 22:30 +0200 |
| Subject | [PATCH v2 1/4] iio: potentiometer: mcp4531: Add support for MCP454x, MCP456x, MCP464x and MCP466x |
| Message-ID | <rOoQO-7uM-21@gated-at.bofh.it> |
| In reply to | #1431580 |
This patch adds support for MCP454x, MCP456x, MCP464x and MCP466x parts.
The main difference with currently supported parts (MCP453x and alike) is
the addition of a non-volatile memory in order to recall the wiper setting
at power-on. This feature is currently not supported and only the
volatile memory is used to set the wiper.
Acked-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
---
drivers/iio/potentiometer/Kconfig | 6 ++--
drivers/iio/potentiometer/mcp4531.c | 72 +++++++++++++++++++++++++++++++++++++
2 files changed, 76 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/potentiometer/Kconfig b/drivers/iio/potentiometer/Kconfig
index 0941c8d4..55c2414 100644
--- a/drivers/iio/potentiometer/Kconfig
+++ b/drivers/iio/potentiometer/Kconfig
@@ -49,8 +49,10 @@ config MCP4531
depends on I2C
help
Say yes here to build support for the Microchip
- MCP4531, MCP4532, MCP4551, MCP4552,
- MCP4631, MCP4632, MCP4651, MCP4652
+ MCP4531, MCP4532, MCP4541, MCP4542,
+ MCP4551, MCP4552, MCP4561, MCP4562,
+ MCP4631, MCP4632, MCP4641, MCP4642,
+ MCP4651, MCP4652, MCP4661, MCP4662
digital potentiomenter chips.
To compile this driver as a module, choose M here: the
diff --git a/drivers/iio/potentiometer/mcp4531.c b/drivers/iio/potentiometer/mcp4531.c
index 3b72e1a..2251173 100644
--- a/drivers/iio/potentiometer/mcp4531.c
+++ b/drivers/iio/potentiometer/mcp4531.c
@@ -8,12 +8,20 @@
* DEVID #Wipers #Positions Resistor Opts (kOhm) i2c address
* mcp4531 1 129 5, 10, 50, 100 010111x
* mcp4532 1 129 5, 10, 50, 100 01011xx
+ * mcp4541 1 129 5, 10, 50, 100 010111x
+ * mcp4542 1 129 5, 10, 50, 100 01011xx
* mcp4551 1 257 5, 10, 50, 100 010111x
* mcp4552 1 257 5, 10, 50, 100 01011xx
+ * mcp4561 1 257 5, 10, 50, 100 010111x
+ * mcp4562 1 257 5, 10, 50, 100 01011xx
* mcp4631 2 129 5, 10, 50, 100 0101xxx
* mcp4632 2 129 5, 10, 50, 100 01011xx
+ * mcp4641 2 129 5, 10, 50, 100 0101xxx
+ * mcp4642 2 129 5, 10, 50, 100 01011xx
* mcp4651 2 257 5, 10, 50, 100 0101xxx
* mcp4652 2 257 5, 10, 50, 100 01011xx
+ * mcp4661 2 257 5, 10, 50, 100 0101xxx
+ * mcp4662 2 257 5, 10, 50, 100 01011xx
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
@@ -37,18 +45,34 @@ enum mcp4531_type {
MCP453x_103,
MCP453x_503,
MCP453x_104,
+ MCP454x_502,
+ MCP454x_103,
+ MCP454x_503,
+ MCP454x_104,
MCP455x_502,
MCP455x_103,
MCP455x_503,
MCP455x_104,
+ MCP456x_502,
+ MCP456x_103,
+ MCP456x_503,
+ MCP456x_104,
MCP463x_502,
MCP463x_103,
MCP463x_503,
MCP463x_104,
+ MCP464x_502,
+ MCP464x_103,
+ MCP464x_503,
+ MCP464x_104,
MCP465x_502,
MCP465x_103,
MCP465x_503,
MCP465x_104,
+ MCP466x_502,
+ MCP466x_103,
+ MCP466x_503,
+ MCP466x_104,
};
static const struct mcp4531_cfg mcp4531_cfg[] = {
@@ -56,18 +80,34 @@ static const struct mcp4531_cfg mcp4531_cfg[] = {
[MCP453x_103] = { .wipers = 1, .max_pos = 128, .kohms = 10, },
[MCP453x_503] = { .wipers = 1, .max_pos = 128, .kohms = 50, },
[MCP453x_104] = { .wipers = 1, .max_pos = 128, .kohms = 100, },
+ [MCP454x_502] = { .wipers = 1, .max_pos = 128, .kohms = 5, },
+ [MCP454x_103] = { .wipers = 1, .max_pos = 128, .kohms = 10, },
+ [MCP454x_503] = { .wipers = 1, .max_pos = 128, .kohms = 50, },
+ [MCP454x_104] = { .wipers = 1, .max_pos = 128, .kohms = 100, },
[MCP455x_502] = { .wipers = 1, .max_pos = 256, .kohms = 5, },
[MCP455x_103] = { .wipers = 1, .max_pos = 256, .kohms = 10, },
[MCP455x_503] = { .wipers = 1, .max_pos = 256, .kohms = 50, },
[MCP455x_104] = { .wipers = 1, .max_pos = 256, .kohms = 100, },
+ [MCP456x_502] = { .wipers = 1, .max_pos = 256, .kohms = 5, },
+ [MCP456x_103] = { .wipers = 1, .max_pos = 256, .kohms = 10, },
+ [MCP456x_503] = { .wipers = 1, .max_pos = 256, .kohms = 50, },
+ [MCP456x_104] = { .wipers = 1, .max_pos = 256, .kohms = 100, },
[MCP463x_502] = { .wipers = 2, .max_pos = 128, .kohms = 5, },
[MCP463x_103] = { .wipers = 2, .max_pos = 128, .kohms = 10, },
[MCP463x_503] = { .wipers = 2, .max_pos = 128, .kohms = 50, },
[MCP463x_104] = { .wipers = 2, .max_pos = 128, .kohms = 100, },
+ [MCP464x_502] = { .wipers = 2, .max_pos = 128, .kohms = 5, },
+ [MCP464x_103] = { .wipers = 2, .max_pos = 128, .kohms = 10, },
+ [MCP464x_503] = { .wipers = 2, .max_pos = 128, .kohms = 50, },
+ [MCP464x_104] = { .wipers = 2, .max_pos = 128, .kohms = 100, },
[MCP465x_502] = { .wipers = 2, .max_pos = 256, .kohms = 5, },
[MCP465x_103] = { .wipers = 2, .max_pos = 256, .kohms = 10, },
[MCP465x_503] = { .wipers = 2, .max_pos = 256, .kohms = 50, },
[MCP465x_104] = { .wipers = 2, .max_pos = 256, .kohms = 100, },
+ [MCP466x_502] = { .wipers = 2, .max_pos = 256, .kohms = 5, },
+ [MCP466x_103] = { .wipers = 2, .max_pos = 256, .kohms = 10, },
+ [MCP466x_503] = { .wipers = 2, .max_pos = 256, .kohms = 50, },
+ [MCP466x_104] = { .wipers = 2, .max_pos = 256, .kohms = 100, },
};
#define MCP4531_WRITE (0 << 2)
@@ -187,6 +227,14 @@ static const struct i2c_device_id mcp4531_id[] = {
{ "mcp4532-103", MCP453x_103 },
{ "mcp4532-503", MCP453x_503 },
{ "mcp4532-104", MCP453x_104 },
+ { "mcp4541-502", MCP454x_502 },
+ { "mcp4541-103", MCP454x_103 },
+ { "mcp4541-503", MCP454x_503 },
+ { "mcp4541-104", MCP454x_104 },
+ { "mcp4542-502", MCP454x_502 },
+ { "mcp4542-103", MCP454x_103 },
+ { "mcp4542-503", MCP454x_503 },
+ { "mcp4542-104", MCP454x_104 },
{ "mcp4551-502", MCP455x_502 },
{ "mcp4551-103", MCP455x_103 },
{ "mcp4551-503", MCP455x_503 },
@@ -195,6 +243,14 @@ static const struct i2c_device_id mcp4531_id[] = {
{ "mcp4552-103", MCP455x_103 },
{ "mcp4552-503", MCP455x_503 },
{ "mcp4552-104", MCP455x_104 },
+ { "mcp4561-502", MCP456x_502 },
+ { "mcp4561-103", MCP456x_103 },
+ { "mcp4561-503", MCP456x_503 },
+ { "mcp4561-104", MCP456x_104 },
+ { "mcp4562-502", MCP456x_502 },
+ { "mcp4562-103", MCP456x_103 },
+ { "mcp4562-503", MCP456x_503 },
+ { "mcp4562-104", MCP456x_104 },
{ "mcp4631-502", MCP463x_502 },
{ "mcp4631-103", MCP463x_103 },
{ "mcp4631-503", MCP463x_503 },
@@ -203,6 +259,14 @@ static const struct i2c_device_id mcp4531_id[] = {
{ "mcp4632-103", MCP463x_103 },
{ "mcp4632-503", MCP463x_503 },
{ "mcp4632-104", MCP463x_104 },
+ { "mcp4641-502", MCP464x_502 },
+ { "mcp4641-103", MCP464x_103 },
+ { "mcp4641-503", MCP464x_503 },
+ { "mcp4641-104", MCP464x_104 },
+ { "mcp4642-502", MCP464x_502 },
+ { "mcp4642-103", MCP464x_103 },
+ { "mcp4642-503", MCP464x_503 },
+ { "mcp4642-104", MCP464x_104 },
{ "mcp4651-502", MCP465x_502 },
{ "mcp4651-103", MCP465x_103 },
{ "mcp4651-503", MCP465x_503 },
@@ -211,6 +275,14 @@ static const struct i2c_device_id mcp4531_id[] = {
{ "mcp4652-103", MCP465x_103 },
{ "mcp4652-503", MCP465x_503 },
{ "mcp4652-104", MCP465x_104 },
+ { "mcp4661-502", MCP466x_502 },
+ { "mcp4661-103", MCP466x_103 },
+ { "mcp4661-503", MCP466x_503 },
+ { "mcp4661-104", MCP466x_104 },
+ { "mcp4662-502", MCP466x_502 },
+ { "mcp4662-103", MCP466x_103 },
+ { "mcp4662-503", MCP466x_503 },
+ { "mcp4662-104", MCP466x_104 },
{}
};
MODULE_DEVICE_TABLE(i2c, mcp4531_id);
--
2.5.5
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web