public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG, bisect] i2c: designware: Move common probe code into i2c_dw_probe()
@ 2015-11-03  4:02 Jeremiah Mahler
  2015-11-03  7:28 ` Jarkko Nikula
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremiah Mahler @ 2015-11-03  4:02 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: Wolfram Sang, Mika Westerberg, Dudley Du, linux-kernel

Jarkko, all,

Commit d80d134182ba5 introduced a bug which causes a cyapa based touch
pad on an Acer C720 Chromebook to become inoperative.  This is present
in the latest linux-next (20151101).  The patch description is repeated
below.

  From d80d134182ba536ececab8d5fca50d779befc9a6 Mon Sep 17 00:00:00 2001
  From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
  Date: Mon, 12 Oct 2015 16:55:35 +0300
  Subject: [PATCH] i2c: designware: Move common probe code into i2c_dw_probe()
  
  There is some code duplication in i2c-designware-platdrv and
  i2c-designware-pcidrv probe functions. What is even worse that duplication
  requires i2c_dw_xfer(), i2c_dw_func() and i2c_dw_isr() i2c-designware-core
  functions to be exported.
  
  Therefore move common code into new i2c_dw_probe() and make functions above
  local to i2c-designware-core.
  
  While merging the code patch does following functional changes:
  
  - I2C Adapter name will be "Synopsys DesignWare I2C adapter". Previously it
    was used for platform and ACPI devices but PCI device used
    "i2c-designware-pci".
  - Using device name for interrupt name. Previous it was platform device name,
    ACPI device name or "i2c-designware-pci".
  - Error code from devm_request_irq() and i2c_add_numbered_adapter() will be
    printed in case of error.
  
  Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
  Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  ---
   drivers/i2c/busses/i2c-designware-core.c    | 49 +++++++++++++++++++++++++----
   drivers/i2c/busses/i2c-designware-core.h    |  5 +--
   drivers/i2c/busses/i2c-designware-pcidrv.c  | 30 ++----------------
   drivers/i2c/busses/i2c-designware-platdrv.c | 28 ++---------------
   4 files changed, 49 insertions(+), 63 deletions(-)

-- 
- Jeremiah Mahler

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG, bisect] i2c: designware: Move common probe code into i2c_dw_probe()
  2015-11-03  4:02 [BUG, bisect] i2c: designware: Move common probe code into i2c_dw_probe() Jeremiah Mahler
@ 2015-11-03  7:28 ` Jarkko Nikula
  2015-11-03 18:15   ` Jeremiah Mahler
  0 siblings, 1 reply; 3+ messages in thread
From: Jarkko Nikula @ 2015-11-03  7:28 UTC (permalink / raw)
  To: Jeremiah Mahler, Wolfram Sang, Mika Westerberg, Dudley Du,
	linux-kernel

Hi

On 03.11.2015 06:02, Jeremiah Mahler wrote:
> Jarkko, all,
>
> Commit d80d134182ba5 introduced a bug which causes a cyapa based touch
> pad on an Acer C720 Chromebook to become inoperative.  This is present
> in the latest linux-next (20151101).  The patch description is repeated
> below.
>
>    From d80d134182ba536ececab8d5fca50d779befc9a6 Mon Sep 17 00:00:00 2001
>    From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
>    Date: Mon, 12 Oct 2015 16:55:35 +0300
>    Subject: [PATCH] i2c: designware: Move common probe code into i2c_dw_probe()
>
>    There is some code duplication in i2c-designware-platdrv and
>    i2c-designware-pcidrv probe functions. What is even worse that duplication
>    requires i2c_dw_xfer(), i2c_dw_func() and i2c_dw_isr() i2c-designware-core
>    functions to be exported.
>
>    Therefore move common code into new i2c_dw_probe() and make functions above
>    local to i2c-designware-core.
>
>    While merging the code patch does following functional changes:
>
>    - I2C Adapter name will be "Synopsys DesignWare I2C adapter". Previously it
>      was used for platform and ACPI devices but PCI device used
>      "i2c-designware-pci".
>    - Using device name for interrupt name. Previous it was platform device name,
>      ACPI device name or "i2c-designware-pci".
>    - Error code from devm_request_irq() and i2c_add_numbered_adapter() will be
>      printed in case of error.
>
>    Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
>    Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
>    ---
>     drivers/i2c/busses/i2c-designware-core.c    | 49 +++++++++++++++++++++++++----
>     drivers/i2c/busses/i2c-designware-core.h    |  5 +--
>     drivers/i2c/busses/i2c-designware-pcidrv.c  | 30 ++----------------
>     drivers/i2c/busses/i2c-designware-platdrv.c | 28 ++---------------
>     4 files changed, 49 insertions(+), 63 deletions(-)
>
Oh, I didn't notice adapter name was used 
drivers/platform/chrome/chromeos_laptop.c. Could you try does a patch 
below help?

============================ CUT HERE ============================
diff --git a/drivers/platform/chrome/chromeos_laptop.c 
b/drivers/platform/chrome/chromeos_laptop.c
index 02072749fff3..2b441e9ae593 100644
--- a/drivers/platform/chrome/chromeos_laptop.c
+++ b/drivers/platform/chrome/chromeos_laptop.c
@@ -47,8 +47,8 @@ static const char *i2c_adapter_names[] = {
  	"SMBus I801 adapter",
  	"i915 gmbus vga",
  	"i915 gmbus panel",
-	"i2c-designware-pci",
-	"i2c-designware-pci",
+	"Synopsys DesignWare I2C adapter",
+	"Synopsys DesignWare I2C adapter",
  };

  /* Keep this enum consistent with i2c_adapter_names */
============================ CUT HERE ============================

-- 
Jarkko

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [BUG, bisect] i2c: designware: Move common probe code into i2c_dw_probe()
  2015-11-03  7:28 ` Jarkko Nikula
@ 2015-11-03 18:15   ` Jeremiah Mahler
  0 siblings, 0 replies; 3+ messages in thread
From: Jeremiah Mahler @ 2015-11-03 18:15 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: Wolfram Sang, Mika Westerberg, Dudley Du, linux-kernel

Jarkko,

On Tue, Nov 03, 2015 at 09:28:55AM +0200, Jarkko Nikula wrote:
> Hi
> 
> On 03.11.2015 06:02, Jeremiah Mahler wrote:
> >Jarkko, all,
> >
> >Commit d80d134182ba5 introduced a bug which causes a cyapa based touch
> >pad on an Acer C720 Chromebook to become inoperative.  This is present
> >in the latest linux-next (20151101).  The patch description is repeated
> >below.
> >
[...]
> Oh, I didn't notice adapter name was used
> drivers/platform/chrome/chromeos_laptop.c. Could you try does a patch below
> help?
> 
> ============================ CUT HERE ============================
> diff --git a/drivers/platform/chrome/chromeos_laptop.c
> b/drivers/platform/chrome/chromeos_laptop.c
> index 02072749fff3..2b441e9ae593 100644
> --- a/drivers/platform/chrome/chromeos_laptop.c
> +++ b/drivers/platform/chrome/chromeos_laptop.c
> @@ -47,8 +47,8 @@ static const char *i2c_adapter_names[] = {
>  	"SMBus I801 adapter",
>  	"i915 gmbus vga",
>  	"i915 gmbus panel",
> -	"i2c-designware-pci",
> -	"i2c-designware-pci",
> +	"Synopsys DesignWare I2C adapter",
> +	"Synopsys DesignWare I2C adapter",
>  };
> 
>  /* Keep this enum consistent with i2c_adapter_names */
> ============================ CUT HERE ============================
> 
> -- 
> Jarkko
> --

Yes, that change fixes the problem.  Thanks for the quick fix.

Tested-by: Jeremiah Mahler <jmmahler@gmail.com>

So the find_i2c_adapter_num function was looking for
"i2c-designware-pci" but it should have been looking for
"Synopsys DesignWare I2C adapter".  Where does this bus name
come from, is it read from the device itself?

-- 
- Jeremiah Mahler

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-03 18:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03  4:02 [BUG, bisect] i2c: designware: Move common probe code into i2c_dw_probe() Jeremiah Mahler
2015-11-03  7:28 ` Jarkko Nikula
2015-11-03 18:15   ` Jeremiah Mahler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox