Skip to content

Commit 11e94f2

Browse files
jwrdegoedejic23
authored andcommitted
iio: accel: kxcjk1013: Replace is_smo8500_device with an acpi_type enum
Replace the boolean is_smo8500_device variable with an acpi_type enum. For now this can be either ACPI_GENERIC or ACPI_SMO8500, this is a preparation patch for adding special handling for the KIOX010A ACPI HID, which will add a ACPI_KIOX010A acpi_type to the introduced enum. For stable as needed as precursor for next patch. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Fixes: 7f6232e ("iio: accel: kxcjk1013: Add KIOX010A ACPI Hardware-ID") Cc: <Stable@vger.kernel.org> Link: https://lore.kernel.org/r/20201110133835.129080-2-hdegoede@redhat.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 44a146a commit 11e94f2

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

drivers/iio/accel/kxcjk-1013.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ enum kx_chipset {
126126
KX_MAX_CHIPS /* this must be last */
127127
};
128128

129+
enum kx_acpi_type {
130+
ACPI_GENERIC,
131+
ACPI_SMO8500,
132+
};
133+
129134
struct kxcjk1013_data {
130135
struct i2c_client *client;
131136
struct iio_trigger *dready_trig;
@@ -143,7 +148,7 @@ struct kxcjk1013_data {
143148
bool motion_trigger_on;
144149
int64_t timestamp;
145150
enum kx_chipset chipset;
146-
bool is_smo8500_device;
151+
enum kx_acpi_type acpi_type;
147152
};
148153

149154
enum kxcjk1013_axis {
@@ -1247,7 +1252,7 @@ static irqreturn_t kxcjk1013_data_rdy_trig_poll(int irq, void *private)
12471252

12481253
static const char *kxcjk1013_match_acpi_device(struct device *dev,
12491254
enum kx_chipset *chipset,
1250-
bool *is_smo8500_device)
1255+
enum kx_acpi_type *acpi_type)
12511256
{
12521257
const struct acpi_device_id *id;
12531258

@@ -1256,7 +1261,7 @@ static const char *kxcjk1013_match_acpi_device(struct device *dev,
12561261
return NULL;
12571262

12581263
if (strcmp(id->id, "SMO8500") == 0)
1259-
*is_smo8500_device = true;
1264+
*acpi_type = ACPI_SMO8500;
12601265

12611266
*chipset = (enum kx_chipset)id->driver_data;
12621267

@@ -1299,7 +1304,7 @@ static int kxcjk1013_probe(struct i2c_client *client,
12991304
} else if (ACPI_HANDLE(&client->dev)) {
13001305
name = kxcjk1013_match_acpi_device(&client->dev,
13011306
&data->chipset,
1302-
&data->is_smo8500_device);
1307+
&data->acpi_type);
13031308
} else
13041309
return -ENODEV;
13051310

@@ -1316,7 +1321,7 @@ static int kxcjk1013_probe(struct i2c_client *client,
13161321
indio_dev->modes = INDIO_DIRECT_MODE;
13171322
indio_dev->info = &kxcjk1013_info;
13181323

1319-
if (client->irq > 0 && !data->is_smo8500_device) {
1324+
if (client->irq > 0 && data->acpi_type != ACPI_SMO8500) {
13201325
ret = devm_request_threaded_irq(&client->dev, client->irq,
13211326
kxcjk1013_data_rdy_trig_poll,
13221327
kxcjk1013_event_handler,

0 commit comments

Comments
 (0)