diff mbox

[4/7] i2c-designware: use dynamic adapter numbering on Lynxpoint

Message ID 1363867800-23861-4-git-send-email-mika.westerberg@linux.intel.com
State Superseded
Headers show

Commit Message

Mika Westerberg March 21, 2013, 12:09 p.m. UTC
It is not good idea to mix static and dynamic I2C adapter numbering. In
this particular case on Lynxpoint we had graphics I2C adapter which took
the first numbers preventing the designware I2C driver from using the
adapter numbers it preferred.

Fix this by switching to use dynamic adapter numbering on Intel Lynxpoint.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/i2c/busses/i2c-designware-platdrv.c |    9 ---------
 1 file changed, 9 deletions(-)

Comments

Wolfram Sang April 9, 2013, 9:06 a.m. UTC | #1
On Thu, Mar 21, 2013 at 02:09:57AM -0000, Mika Westerberg wrote:
> It is not good idea to mix static and dynamic I2C adapter numbering. In
> this particular case on Lynxpoint we had graphics I2C adapter which took
> the first numbers preventing the designware I2C driver from using the
> adapter numbers it preferred.
> 
> Fix this by switching to use dynamic adapter numbering on Intel Lynxpoint.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

I am fearing regressions here if the bus numbering changes.

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mika Westerberg April 9, 2013, 9:23 a.m. UTC | #2
On Tue, Apr 09, 2013 at 11:06:05AM +0200, Wolfram Sang wrote:
> On Thu, Mar 21, 2013 at 02:09:57AM -0000, Mika Westerberg wrote:
> > It is not good idea to mix static and dynamic I2C adapter numbering. In
> > this particular case on Lynxpoint we had graphics I2C adapter which took
> > the first numbers preventing the designware I2C driver from using the
> > adapter numbers it preferred.
> > 
> > Fix this by switching to use dynamic adapter numbering on Intel Lynxpoint.
> > 
> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> 
> I am fearing regressions here if the bus numbering changes.

There are no users for this dynamic numbering yet since it was introduced
with the Lynxpoint support.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfram Sang April 9, 2013, 9:29 a.m. UTC | #3
On Tue, Apr 09, 2013 at 12:23:19PM +0300, Mika Westerberg wrote:
> On Tue, Apr 09, 2013 at 11:06:05AM +0200, Wolfram Sang wrote:
> > On Thu, Mar 21, 2013 at 02:09:57AM -0000, Mika Westerberg wrote:
> > > It is not good idea to mix static and dynamic I2C adapter numbering. In
> > > this particular case on Lynxpoint we had graphics I2C adapter which took
> > > the first numbers preventing the designware I2C driver from using the
> > > adapter numbers it preferred.
> > > 
> > > Fix this by switching to use dynamic adapter numbering on Intel Lynxpoint.
> > > 
> > > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > 
> > I am fearing regressions here if the bus numbering changes.
> 
> There are no users for this dynamic numbering yet since it was introduced
> with the Lynxpoint support.

Please add this to the commit msg.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mika Westerberg April 9, 2013, 9:37 a.m. UTC | #4
On Tue, Apr 09, 2013 at 11:29:24AM +0200, Wolfram Sang wrote:
> On Tue, Apr 09, 2013 at 12:23:19PM +0300, Mika Westerberg wrote:
> > On Tue, Apr 09, 2013 at 11:06:05AM +0200, Wolfram Sang wrote:
> > > On Thu, Mar 21, 2013 at 02:09:57AM -0000, Mika Westerberg wrote:
> > > > It is not good idea to mix static and dynamic I2C adapter numbering. In
> > > > this particular case on Lynxpoint we had graphics I2C adapter which took
> > > > the first numbers preventing the designware I2C driver from using the
> > > > adapter numbers it preferred.
> > > > 
> > > > Fix this by switching to use dynamic adapter numbering on Intel Lynxpoint.
> > > > 
> > > > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > > 
> > > I am fearing regressions here if the bus numbering changes.
> > 
> > There are no users for this dynamic numbering yet since it was introduced
> > with the Lynxpoint support.
> 
> Please add this to the commit msg.

Sure, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index c19c4ce..a22a852 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -56,20 +56,11 @@  static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev)
 static int dw_i2c_acpi_configure(struct platform_device *pdev)
 {
 	struct dw_i2c_dev *dev = platform_get_drvdata(pdev);
-	struct acpi_device *adev;
-	int busno, ret;
 
 	if (!ACPI_HANDLE(&pdev->dev))
 		return -ENODEV;
 
-	ret = acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev);
-	if (ret)
-		return -ENODEV;
-
 	dev->adapter.nr = -1;
-	if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0, &busno))
-		dev->adapter.nr = busno;
-
 	dev->tx_fifo_depth = 32;
 	dev->rx_fifo_depth = 32;
 	return 0;