LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	platform-driver-x86@vger.kernel.org,
	Eric Piel <eric.piel@tremplin-utc.net>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <mgross@linux.intel.com>
Subject: Re: [PATCH v2 1/2] platform/x86: hp_accel: Remove _INI method call
Date: Wed, 25 Aug 2021 18:40:17 +0800	[thread overview]
Message-ID: <CAAd53p5V2BcjG=Sds==qdOomZpCJON94B93DRU+fPkzTffGCyQ@mail.gmail.com> (raw)
In-Reply-To: <20210823093222.19544-2-andriy.shevchenko@linux.intel.com>

On Mon, Aug 23, 2021 at 5:32 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> 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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

The lis3lv02d still works after boot and after resume.

Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>

> ---
>  drivers/misc/lis3lv02d/lis3lv02d.h |  1 -
>  drivers/platform/x86/hp_accel.c    | 14 +-------------
>  2 files changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/drivers/misc/lis3lv02d/lis3lv02d.h b/drivers/misc/lis3lv02d/lis3lv02d.h
> index 7ac788fae1b8..c394c0b08519 100644
> --- a/drivers/misc/lis3lv02d/lis3lv02d.h
> +++ b/drivers/misc/lis3lv02d/lis3lv02d.h
> @@ -271,7 +271,6 @@ struct lis3lv02d {
>         int                     regs_size;
>         u8                      *reg_cache;
>         bool                    regs_stored;
> -       bool                    init_required;
>         u8                      odr_mask;  /* ODR bit mask */
>         u8                      whoami;    /* indicates measurement precision */
>         s16 (*read_data) (struct lis3lv02d *lis3, int reg);
> diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c
> index 8c0867bda828..54a4addc7903 100644
> --- a/drivers/platform/x86/hp_accel.c
> +++ b/drivers/platform/x86/hp_accel.c
> @@ -78,23 +78,14 @@ static const struct acpi_device_id 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
>   *
>   * Returns 0 on success.
>   */
>  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;
>  }
>
> @@ -359,7 +350,6 @@ static int lis3lv02d_add(struct acpi_device *device)
>         }
>
>         /* call the core layer do its init */
> -       lis3_dev.init_required = true;
>         ret = lis3lv02d_init_device(&lis3_dev);
>         if (ret)
>                 return ret;
> @@ -407,14 +397,12 @@ static int lis3lv02d_suspend(struct device *dev)
>
>  static int lis3lv02d_resume(struct device *dev)
>  {
> -       lis3_dev.init_required = false;
>         lis3lv02d_poweron(&lis3_dev);
>         return 0;
>  }
>
>  static int lis3lv02d_restore(struct device *dev)
>  {
> -       lis3_dev.init_required = true;
>         lis3lv02d_poweron(&lis3_dev);
>         return 0;
>  }
> --
> 2.32.0
>

  reply	other threads:[~2021-08-25 10:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23  9:32 [RFT, PATCH v2 0/2] platform/x86: hp_accel: Clean up and convert Andy Shevchenko
2021-08-23  9:32 ` [PATCH v2 1/2] platform/x86: hp_accel: Remove _INI method call Andy Shevchenko
2021-08-25 10:40   ` Kai-Heng Feng [this message]
2021-08-23  9:32 ` [PATCH v2 2/2] platform/x86: hp_accel: Convert to be a platform driver Andy Shevchenko
2021-08-25 10:41   ` Kai-Heng Feng
2021-08-25 11:11     ` Andy Shevchenko
2021-08-26 13:13 ` [RFT, PATCH v2 0/2] platform/x86: hp_accel: Clean up and convert Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAd53p5V2BcjG=Sds==qdOomZpCJON94B93DRU+fPkzTffGCyQ@mail.gmail.com' \
    --to=kai.heng.feng@canonical.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=eric.piel@tremplin-utc.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --subject='Re: [PATCH v2 1/2] platform/x86: hp_accel: Remove _INI method call' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).