All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>,
	Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-i2c@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz
Date: Sat, 08 Jul 2017 16:55:54 +0300	[thread overview]
Message-ID: <1499522154.22624.307.camel@linux.intel.com> (raw)
In-Reply-To: <20170708131052.13524-2-hdegoede@redhat.com>

On Sat, 2017-07-08 at 15:10 +0200, Hans de Goede wrote:
> At least the Acer Iconia Tab8 / aka W1-810 uses 1MiHz instead of
> 1MHz for one of its busses, fix this up to 1MHz instead of failing
> the probe of that bus.
> 
> This fixes the accelerometer on the Acer Iconia Tab8 not working.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/i2c/busses/i2c-designware-platdrv.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c
> b/drivers/i2c/busses/i2c-designware-platdrv.c
> index d5acaf8d65bf..c6f5a41d72b5 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -254,6 +254,9 @@ static int dw_i2c_plat_probe(struct
> platform_device *pdev)
>  	}
>  
>  	acpi_speed = i2c_acpi_find_bus_speed(&pdev->dev);
> +	/* Some broken DSTDs use 1MiHz instead of 1MHz */
> +	if (acpi_speed == 1048576)
> +		acpi_speed = 1000000;

I would rather convert to choose closest one, though I am not sure at
all which approach would be better in long term.

>  	/*
>  	 * Find bus speed from the "clock-frequency" device property,
> ACPI
>  	 * or by using fast mode if neither is set.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

  reply	other threads:[~2017-07-08 14:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-08 13:10 [PATCH 1/2] i2c: designware: Print clock freq on invalid clock freq error Hans de Goede
2017-07-08 13:10 ` [PATCH 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz Hans de Goede
2017-07-08 13:55   ` Andy Shevchenko [this message]
2017-07-09 18:54     ` Hans de Goede
2017-07-08 13:54 ` [PATCH 1/2] i2c: designware: Print clock freq on invalid clock freq error Andy Shevchenko
2017-07-09 18:53   ` 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=1499522154.22624.307.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=stable@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.