diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2017-03-30 10:53:48 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2017-03-30 10:53:48 -0400 |
commit | 0bf9e1270b56b2376ba3b16d951cd0ed7c573f54 (patch) | |
tree | 9d24d895542f96f4571efebab2641096dcf4d642 | |
parent | 97da3854c526d3a6ee05c849c96e48d21527606c (diff) | |
parent | dbe4d69d252e9e65c6c46826980b77b11a142065 (diff) |
Merge branch 'i2c-mux/for-current' of https://github.com/peda-r/i2c-mux into i2c/for-current
Pull in changes for 4.11 from the i2c-mux subsubsystem:
"Here are some changes for the pca954x driver. It's a revert of the
un-endorsed ACPI support and a fixup in the handling of PCA9546."
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-pca954x.c | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c index dfc1c0e37c40..ad31d21da316 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c | |||
@@ -35,7 +35,6 @@ | |||
35 | * warranty of any kind, whether express or implied. | 35 | * warranty of any kind, whether express or implied. |
36 | */ | 36 | */ |
37 | 37 | ||
38 | #include <linux/acpi.h> | ||
39 | #include <linux/device.h> | 38 | #include <linux/device.h> |
40 | #include <linux/gpio/consumer.h> | 39 | #include <linux/gpio/consumer.h> |
41 | #include <linux/i2c.h> | 40 | #include <linux/i2c.h> |
@@ -117,6 +116,10 @@ static const struct chip_desc chips[] = { | |||
117 | .has_irq = 1, | 116 | .has_irq = 1, |
118 | .muxtype = pca954x_isswi, | 117 | .muxtype = pca954x_isswi, |
119 | }, | 118 | }, |
119 | [pca_9546] = { | ||
120 | .nchans = 4, | ||
121 | .muxtype = pca954x_isswi, | ||
122 | }, | ||
120 | [pca_9547] = { | 123 | [pca_9547] = { |
121 | .nchans = 8, | 124 | .nchans = 8, |
122 | .enable = 0x8, | 125 | .enable = 0x8, |
@@ -134,28 +137,13 @@ static const struct i2c_device_id pca954x_id[] = { | |||
134 | { "pca9543", pca_9543 }, | 137 | { "pca9543", pca_9543 }, |
135 | { "pca9544", pca_9544 }, | 138 | { "pca9544", pca_9544 }, |
136 | { "pca9545", pca_9545 }, | 139 | { "pca9545", pca_9545 }, |
137 | { "pca9546", pca_9545 }, | 140 | { "pca9546", pca_9546 }, |
138 | { "pca9547", pca_9547 }, | 141 | { "pca9547", pca_9547 }, |
139 | { "pca9548", pca_9548 }, | 142 | { "pca9548", pca_9548 }, |
140 | { } | 143 | { } |
141 | }; | 144 | }; |
142 | MODULE_DEVICE_TABLE(i2c, pca954x_id); | 145 | MODULE_DEVICE_TABLE(i2c, pca954x_id); |
143 | 146 | ||
144 | #ifdef CONFIG_ACPI | ||
145 | static const struct acpi_device_id pca954x_acpi_ids[] = { | ||
146 | { .id = "PCA9540", .driver_data = pca_9540 }, | ||
147 | { .id = "PCA9542", .driver_data = pca_9542 }, | ||
148 | { .id = "PCA9543", .driver_data = pca_9543 }, | ||
149 | { .id = "PCA9544", .driver_data = pca_9544 }, | ||
150 | { .id = "PCA9545", .driver_data = pca_9545 }, | ||
151 | { .id = "PCA9546", .driver_data = pca_9545 }, | ||
152 | { .id = "PCA9547", .driver_data = pca_9547 }, | ||
153 | { .id = "PCA9548", .driver_data = pca_9548 }, | ||
154 | { } | ||
155 | }; | ||
156 | MODULE_DEVICE_TABLE(acpi, pca954x_acpi_ids); | ||
157 | #endif | ||
158 | |||
159 | #ifdef CONFIG_OF | 147 | #ifdef CONFIG_OF |
160 | static const struct of_device_id pca954x_of_match[] = { | 148 | static const struct of_device_id pca954x_of_match[] = { |
161 | { .compatible = "nxp,pca9540", .data = &chips[pca_9540] }, | 149 | { .compatible = "nxp,pca9540", .data = &chips[pca_9540] }, |
@@ -393,17 +381,8 @@ static int pca954x_probe(struct i2c_client *client, | |||
393 | match = of_match_device(of_match_ptr(pca954x_of_match), &client->dev); | 381 | match = of_match_device(of_match_ptr(pca954x_of_match), &client->dev); |
394 | if (match) | 382 | if (match) |
395 | data->chip = of_device_get_match_data(&client->dev); | 383 | data->chip = of_device_get_match_data(&client->dev); |
396 | else if (id) | 384 | else |
397 | data->chip = &chips[id->driver_data]; | 385 | data->chip = &chips[id->driver_data]; |
398 | else { | ||
399 | const struct acpi_device_id *acpi_id; | ||
400 | |||
401 | acpi_id = acpi_match_device(ACPI_PTR(pca954x_acpi_ids), | ||
402 | &client->dev); | ||
403 | if (!acpi_id) | ||
404 | return -ENODEV; | ||
405 | data->chip = &chips[acpi_id->driver_data]; | ||
406 | } | ||
407 | 386 | ||
408 | data->last_chan = 0; /* force the first selection */ | 387 | data->last_chan = 0; /* force the first selection */ |
409 | 388 | ||
@@ -492,7 +471,6 @@ static struct i2c_driver pca954x_driver = { | |||
492 | .name = "pca954x", | 471 | .name = "pca954x", |
493 | .pm = &pca954x_pm, | 472 | .pm = &pca954x_pm, |
494 | .of_match_table = of_match_ptr(pca954x_of_match), | 473 | .of_match_table = of_match_ptr(pca954x_of_match), |
495 | .acpi_match_table = ACPI_PTR(pca954x_acpi_ids), | ||
496 | }, | 474 | }, |
497 | .probe = pca954x_probe, | 475 | .probe = pca954x_probe, |
498 | .remove = pca954x_remove, | 476 | .remove = pca954x_remove, |