Skip to content

Commit 3bfa74f

Browse files
hadessjic23
authored andcommitted
iio:kxcjk-1013: Add support for SMO8500 device
The Onda v975w tablet contains an accelerometer that's advertised over ACPI as SMO8500. This device is however a KXCJ9 accelerometer as can be seen in the Windows driver's INF file, and from the etching on the chipset ("KXCJ9 41566 0414"). This patch also removes the attempt to get the IRQ for the "data ready" signal, as it does not seem to be supported by this device on this platform. Signed-off-by: Bastien Nocera <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 995863c commit 3bfa74f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/iio/accel/kxcjk-1013.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ struct kxcjk1013_data {
108108
bool motion_trigger_on;
109109
int64_t timestamp;
110110
enum kx_chipset chipset;
111+
bool is_smo8500_device;
111112
};
112113

113114
enum kxcjk1013_axis {
@@ -1129,12 +1130,15 @@ static irqreturn_t kxcjk1013_data_rdy_trig_poll(int irq, void *private)
11291130
}
11301131

11311132
static const char *kxcjk1013_match_acpi_device(struct device *dev,
1132-
enum kx_chipset *chipset)
1133+
enum kx_chipset *chipset,
1134+
bool *is_smo8500_device)
11331135
{
11341136
const struct acpi_device_id *id;
11351137
id = acpi_match_device(dev->driver->acpi_match_table, dev);
11361138
if (!id)
11371139
return NULL;
1140+
if (strcmp(id->id, "SMO8500") == 0)
1141+
*is_smo8500_device = true;
11381142
*chipset = (enum kx_chipset)id->driver_data;
11391143

11401144
return dev_name(dev);
@@ -1149,6 +1153,8 @@ static int kxcjk1013_gpio_probe(struct i2c_client *client,
11491153

11501154
if (!client)
11511155
return -EINVAL;
1156+
if (data->is_smo8500_device)
1157+
return -ENOTSUPP;
11521158

11531159
dev = &client->dev;
11541160

@@ -1198,7 +1204,8 @@ static int kxcjk1013_probe(struct i2c_client *client,
11981204
name = id->name;
11991205
} else if (ACPI_HANDLE(&client->dev)) {
12001206
name = kxcjk1013_match_acpi_device(&client->dev,
1201-
&data->chipset);
1207+
&data->chipset,
1208+
&data->is_smo8500_device);
12021209
} else
12031210
return -ENODEV;
12041211

@@ -1397,6 +1404,7 @@ static const struct acpi_device_id kx_acpi_match[] = {
13971404
{"KXCJ1013", KXCJK1013},
13981405
{"KXCJ1008", KXCJ91008},
13991406
{"KXTJ1009", KXTJ21009},
1407+
{"SMO8500", KXCJ91008},
14001408
{ },
14011409
};
14021410
MODULE_DEVICE_TABLE(acpi, kx_acpi_match);
@@ -1405,6 +1413,7 @@ static const struct i2c_device_id kxcjk1013_id[] = {
14051413
{"kxcjk1013", KXCJK1013},
14061414
{"kxcj91008", KXCJ91008},
14071415
{"kxtj21009", KXTJ21009},
1416+
{"SMO8500", KXCJ91008},
14081417
{}
14091418
};
14101419

0 commit comments

Comments
 (0)