Commit 34570a89 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Hans de Goede

platform/x86: hp_accel: Remove _INI method call

According to ACPI specification the _INI method must be called
when device is enumerated first time. After that there is no need
to repeat the procedure. Convert the lis3lv02d_acpi_init() to be
a stub (Note, we may not remove it because it is called unconditionally
by the accelerometer main driver).
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20210823093222.19544-2-andriy.shevchenko@linux.intel.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 0c59e612
...@@ -271,7 +271,6 @@ struct lis3lv02d { ...@@ -271,7 +271,6 @@ struct lis3lv02d {
int regs_size; int regs_size;
u8 *reg_cache; u8 *reg_cache;
bool regs_stored; bool regs_stored;
bool init_required;
u8 odr_mask; /* ODR bit mask */ u8 odr_mask; /* ODR bit mask */
u8 whoami; /* indicates measurement precision */ u8 whoami; /* indicates measurement precision */
s16 (*read_data) (struct lis3lv02d *lis3, int reg); s16 (*read_data) (struct lis3lv02d *lis3, int reg);
......
...@@ -78,23 +78,14 @@ static const struct acpi_device_id lis3lv02d_device_ids[] = { ...@@ -78,23 +78,14 @@ static const struct acpi_device_id lis3lv02d_device_ids[] = {
}; };
MODULE_DEVICE_TABLE(acpi, lis3lv02d_device_ids); MODULE_DEVICE_TABLE(acpi, lis3lv02d_device_ids);
/** /**
* lis3lv02d_acpi_init - ACPI _INI method: initialize the device. * lis3lv02d_acpi_init - initialize the device for ACPI
* @lis3: pointer to the device struct * @lis3: pointer to the device struct
* *
* Returns 0 on success. * Returns 0 on success.
*/ */
static int lis3lv02d_acpi_init(struct lis3lv02d *lis3) static int lis3lv02d_acpi_init(struct lis3lv02d *lis3)
{ {
struct acpi_device *dev = lis3->bus_priv;
if (!lis3->init_required)
return 0;
if (acpi_evaluate_object(dev->handle, METHOD_NAME__INI,
NULL, NULL) != AE_OK)
return -EINVAL;
return 0; return 0;
} }
...@@ -359,7 +350,6 @@ static int lis3lv02d_add(struct acpi_device *device) ...@@ -359,7 +350,6 @@ static int lis3lv02d_add(struct acpi_device *device)
} }
/* call the core layer do its init */ /* call the core layer do its init */
lis3_dev.init_required = true;
ret = lis3lv02d_init_device(&lis3_dev); ret = lis3lv02d_init_device(&lis3_dev);
if (ret) if (ret)
return ret; return ret;
...@@ -407,14 +397,12 @@ static int lis3lv02d_suspend(struct device *dev) ...@@ -407,14 +397,12 @@ static int lis3lv02d_suspend(struct device *dev)
static int lis3lv02d_resume(struct device *dev) static int lis3lv02d_resume(struct device *dev)
{ {
lis3_dev.init_required = false;
lis3lv02d_poweron(&lis3_dev); lis3lv02d_poweron(&lis3_dev);
return 0; return 0;
} }
static int lis3lv02d_restore(struct device *dev) static int lis3lv02d_restore(struct device *dev)
{ {
lis3_dev.init_required = true;
lis3lv02d_poweron(&lis3_dev); lis3lv02d_poweron(&lis3_dev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment