hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/i2c/muxes/i2c-mux-pca9541.c
....@@ -16,13 +16,13 @@
1616 * warranty of any kind, whether express or implied.
1717 */
1818
19
+#include <linux/bitops.h>
1920 #include <linux/delay.h>
2021 #include <linux/device.h>
2122 #include <linux/i2c.h>
2223 #include <linux/i2c-mux.h>
2324 #include <linux/jiffies.h>
2425 #include <linux/module.h>
25
-#include <linux/platform_data/pca954x.h>
2626 #include <linux/slab.h>
2727
2828 /*
....@@ -43,20 +43,20 @@
4343 #define PCA9541_CONTROL 0x01
4444 #define PCA9541_ISTAT 0x02
4545
46
-#define PCA9541_CTL_MYBUS (1 << 0)
47
-#define PCA9541_CTL_NMYBUS (1 << 1)
48
-#define PCA9541_CTL_BUSON (1 << 2)
49
-#define PCA9541_CTL_NBUSON (1 << 3)
50
-#define PCA9541_CTL_BUSINIT (1 << 4)
51
-#define PCA9541_CTL_TESTON (1 << 6)
52
-#define PCA9541_CTL_NTESTON (1 << 7)
46
+#define PCA9541_CTL_MYBUS BIT(0)
47
+#define PCA9541_CTL_NMYBUS BIT(1)
48
+#define PCA9541_CTL_BUSON BIT(2)
49
+#define PCA9541_CTL_NBUSON BIT(3)
50
+#define PCA9541_CTL_BUSINIT BIT(4)
51
+#define PCA9541_CTL_TESTON BIT(6)
52
+#define PCA9541_CTL_NTESTON BIT(7)
5353
54
-#define PCA9541_ISTAT_INTIN (1 << 0)
55
-#define PCA9541_ISTAT_BUSINIT (1 << 1)
56
-#define PCA9541_ISTAT_BUSOK (1 << 2)
57
-#define PCA9541_ISTAT_BUSLOST (1 << 3)
58
-#define PCA9541_ISTAT_MYTEST (1 << 6)
59
-#define PCA9541_ISTAT_NMYTEST (1 << 7)
54
+#define PCA9541_ISTAT_INTIN BIT(0)
55
+#define PCA9541_ISTAT_BUSINIT BIT(1)
56
+#define PCA9541_ISTAT_BUSOK BIT(2)
57
+#define PCA9541_ISTAT_BUSLOST BIT(3)
58
+#define PCA9541_ISTAT_MYTEST BIT(6)
59
+#define PCA9541_ISTAT_NMYTEST BIT(7)
6060
6161 #define BUSON (PCA9541_CTL_BUSON | PCA9541_CTL_NBUSON)
6262 #define MYBUS (PCA9541_CTL_MYBUS | PCA9541_CTL_NMYBUS)
....@@ -287,10 +287,8 @@
287287 const struct i2c_device_id *id)
288288 {
289289 struct i2c_adapter *adap = client->adapter;
290
- struct pca954x_platform_data *pdata = dev_get_platdata(&client->dev);
291290 struct i2c_mux_core *muxc;
292291 struct pca9541 *data;
293
- int force;
294292 int ret;
295293
296294 if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_BYTE_DATA))
....@@ -306,9 +304,6 @@
306304
307305 /* Create mux adapter */
308306
309
- force = 0;
310
- if (pdata)
311
- force = pdata->modes[0].adap_id;
312307 muxc = i2c_mux_alloc(adap, &client->dev, 1, sizeof(*data),
313308 I2C_MUX_ARBITRATOR,
314309 pca9541_select_chan, pca9541_release_chan);
....@@ -320,7 +315,7 @@
320315
321316 i2c_set_clientdata(client, muxc);
322317
323
- ret = i2c_mux_add_adapter(muxc, force, 0, 0);
318
+ ret = i2c_mux_add_adapter(muxc, 0, 0, 0);
324319 if (ret)
325320 return ret;
326321