linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] i2c: designware: Consolidate default functionality bits
@ 2016-11-21 10:43 Alexander Stein
  2016-11-23 14:16 ` Jarkko Nikula
  2016-11-29 19:20 ` Wolfram Sang
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Stein @ 2016-11-21 10:43 UTC (permalink / raw)
  To: Jarkko Nikula, Andy Shevchenko, Mika Westerberg, Wolfram Sang
  Cc: Alexander Stein, linux-i2c

Use a common place for default functionality bits for both platform
and pci driver.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
This patch requires commit c3ae106050b9 ("i2c: designware: Implement support
for SMBus block read and write") which is included in current i2c/for-next
branch.
BTW: Do merrifield and medfield actually not support 10bit addressing?

 drivers/i2c/busses/i2c-designware-core.h    | 8 ++++++++
 drivers/i2c/busses/i2c-designware-pcidrv.c  | 9 +--------
 drivers/i2c/busses/i2c-designware-platdrv.c | 9 +--------
 3 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h
index 0d44d2a..26250b4 100644
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -22,6 +22,14 @@
  *
  */
 
+#include <linux/i2c.h>
+
+#define DW_IC_DEFAULT_FUNCTIONALITY (I2C_FUNC_I2C |			\
+					I2C_FUNC_SMBUS_BYTE |		\
+					I2C_FUNC_SMBUS_BYTE_DATA |	\
+					I2C_FUNC_SMBUS_WORD_DATA |	\
+					I2C_FUNC_SMBUS_BLOCK_DATA |	\
+					I2C_FUNC_SMBUS_I2C_BLOCK)
 
 #define DW_IC_CON_MASTER		0x1
 #define DW_IC_CON_SPEED_STD		0x2
diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index 8ffe2da..300802e7 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -71,13 +71,6 @@ struct dw_pci_controller {
 				DW_IC_CON_SLAVE_DISABLE |	\
 				DW_IC_CON_RESTART_EN)
 
-#define DW_DEFAULT_FUNCTIONALITY (I2C_FUNC_I2C |			\
-					I2C_FUNC_SMBUS_BYTE |		\
-					I2C_FUNC_SMBUS_BYTE_DATA |	\
-					I2C_FUNC_SMBUS_WORD_DATA |	\
-					I2C_FUNC_SMBUS_BLOCK_DATA |	\
-					I2C_FUNC_SMBUS_I2C_BLOCK)
-
 /* Merrifield HCNT/LCNT/SDA hold time */
 static struct dw_scl_sda_cfg mrfld_config = {
 	.ss_hcnt = 0x2f8,
@@ -250,7 +243,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
 	}
 
 	dev->functionality = controller->functionality |
-				DW_DEFAULT_FUNCTIONALITY;
+				DW_IC_DEFAULT_FUNCTIONALITY;
 
 	dev->master_cfg = controller->bus_cfg;
 	if (controller->scl_sda_cfg) {
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 7429dfa..08153ea 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -219,14 +219,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
 	if (r)
 		return r;
 
-	dev->functionality =
-		I2C_FUNC_I2C |
-		I2C_FUNC_10BIT_ADDR |
-		I2C_FUNC_SMBUS_BYTE |
-		I2C_FUNC_SMBUS_BYTE_DATA |
-		I2C_FUNC_SMBUS_WORD_DATA |
-		I2C_FUNC_SMBUS_BLOCK_DATA |
-		I2C_FUNC_SMBUS_I2C_BLOCK;
+	dev->functionality = I2C_FUNC_10BIT_ADDR | DW_IC_DEFAULT_FUNCTIONALITY;
 
 	dev->master_cfg = DW_IC_CON_MASTER | DW_IC_CON_SLAVE_DISABLE |
 			  DW_IC_CON_RESTART_EN;
-- 
2.7.3

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

* Re: [PATCH 1/1] i2c: designware: Consolidate default functionality bits
  2016-11-21 10:43 [PATCH 1/1] i2c: designware: Consolidate default functionality bits Alexander Stein
@ 2016-11-23 14:16 ` Jarkko Nikula
  2016-11-23 16:12   ` Andy Shevchenko
  2016-11-29 19:20 ` Wolfram Sang
  1 sibling, 1 reply; 4+ messages in thread
From: Jarkko Nikula @ 2016-11-23 14:16 UTC (permalink / raw)
  To: Alexander Stein, Andy Shevchenko, Mika Westerberg, Wolfram Sang; +Cc: linux-i2c

On 21.11.2016 12:43, Alexander Stein wrote:
> Use a common place for default functionality bits for both platform
> and pci driver.
>
> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
> ---
> This patch requires commit c3ae106050b9 ("i2c: designware: Implement support
> for SMBus block read and write") which is included in current i2c/for-next
> branch.
> BTW: Do merrifield and medfield actually not support 10bit addressing?
>
Andy, do you know?

>  drivers/i2c/busses/i2c-designware-core.h    | 8 ++++++++
>  drivers/i2c/busses/i2c-designware-pcidrv.c  | 9 +--------
>  drivers/i2c/busses/i2c-designware-platdrv.c | 9 +--------
>  3 files changed, 10 insertions(+), 16 deletions(-)
>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

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

* Re: [PATCH 1/1] i2c: designware: Consolidate default functionality bits
  2016-11-23 14:16 ` Jarkko Nikula
@ 2016-11-23 16:12   ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2016-11-23 16:12 UTC (permalink / raw)
  To: Jarkko Nikula, Alexander Stein, Mika Westerberg, Wolfram Sang; +Cc: linux-i2c

On Wed, 2016-11-23 at 16:16 +0200, Jarkko Nikula wrote:
> On 21.11.2016 12:43, Alexander Stein wrote:
> > Use a common place for default functionality bits for both platform
> > and pci driver.
> > 
> > Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.co
> > m>
> > ---
> > This patch requires commit c3ae106050b9 ("i2c: designware: Implement
> > support
> > for SMBus block read and write") which is included in current
> > i2c/for-next
> > branch.
> > BTW: Do merrifield and medfield actually not support 10bit
> > addressing?
> > 
> 
> Andy, do you know?

Merrifield TRM: "Both 7-bit and 10-bit addressing modes are supported."
Same in Medfield TRM.

So, feel free to use this reference to apply a corresponding change. I
will Ack it.

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

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

* Re: [PATCH 1/1] i2c: designware: Consolidate default functionality bits
  2016-11-21 10:43 [PATCH 1/1] i2c: designware: Consolidate default functionality bits Alexander Stein
  2016-11-23 14:16 ` Jarkko Nikula
@ 2016-11-29 19:20 ` Wolfram Sang
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2016-11-29 19:20 UTC (permalink / raw)
  To: Alexander Stein
  Cc: Jarkko Nikula, Andy Shevchenko, Mika Westerberg, Wolfram Sang,
	linux-i2c

[-- Attachment #1: Type: text/plain, Size: 344 bytes --]

On Mon, Nov 21, 2016 at 11:43:20AM +0100, Alexander Stein wrote:
> Use a common place for default functionality bits for both platform
> and pci driver.
> 
> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>

Applied to for-next, thanks! For the other change discussed, an
incremental patch needs to be send now.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-11-29 19:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-21 10:43 [PATCH 1/1] i2c: designware: Consolidate default functionality bits Alexander Stein
2016-11-23 14:16 ` Jarkko Nikula
2016-11-23 16:12   ` Andy Shevchenko
2016-11-29 19:20 ` Wolfram Sang

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).