All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] i2c: brcmstb: add support for BMIPS_GENERIC
@ 2015-10-21  2:36 ` Jaedon Shin
  0 siblings, 0 replies; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:36 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA, Jaedon Shin

Hi all,

This patch series adds support for BMIPS_GENERIC, and fixes running conditions.

Thanks.

Jaedon Shin (9):
  i2c: brcmstb: make the driver buildable on BMIPS_GENERIC
  i2c: brcmstb: fix typo in i2c-brcmstb
  i2c: brcmstb: add missing parenthesis
  i2c: brcmstb: enable ACK condition
  i2c: brcmstb: fix start and stop conditions
  MIPS: BMIPS: brcmstb: add I2C node for bcm7346
  MIPS: BMIPS: brcmstb: add I2C node for bcm7358
  MIPS: BMIPS: brcmstb: add I2C node for bcm7360
  MIPS: BMIPS: brcmstb: add I2C node for bcm7362

 arch/mips/boot/dts/brcm/bcm7346.dtsi      | 72 ++++++++++++++++++++++++++++++-
 arch/mips/boot/dts/brcm/bcm7358.dtsi      | 62 +++++++++++++++++++++++++-
 arch/mips/boot/dts/brcm/bcm7360.dtsi      | 62 +++++++++++++++++++++++++-
 arch/mips/boot/dts/brcm/bcm7362.dtsi      | 52 +++++++++++++++++++++-
 arch/mips/boot/dts/brcm/bcm97346dbsmb.dts | 20 +++++++++
 arch/mips/boot/dts/brcm/bcm97358svmb.dts  | 16 +++++++
 arch/mips/boot/dts/brcm/bcm97360svmb.dts  | 16 +++++++
 arch/mips/boot/dts/brcm/bcm97362svmb.dts  | 12 ++++++
 drivers/i2c/busses/Kconfig                |  2 +-
 drivers/i2c/busses/i2c-brcmstb.c          | 11 +++--
 10 files changed, 310 insertions(+), 15 deletions(-)

-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 0/9] i2c: brcmstb: add support for BMIPS_GENERIC
@ 2015-10-21  2:36 ` Jaedon Shin
  0 siblings, 0 replies; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:36 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c, devicetree, linux-mips, Jaedon Shin

Hi all,

This patch series adds support for BMIPS_GENERIC, and fixes running conditions.

Thanks.

Jaedon Shin (9):
  i2c: brcmstb: make the driver buildable on BMIPS_GENERIC
  i2c: brcmstb: fix typo in i2c-brcmstb
  i2c: brcmstb: add missing parenthesis
  i2c: brcmstb: enable ACK condition
  i2c: brcmstb: fix start and stop conditions
  MIPS: BMIPS: brcmstb: add I2C node for bcm7346
  MIPS: BMIPS: brcmstb: add I2C node for bcm7358
  MIPS: BMIPS: brcmstb: add I2C node for bcm7360
  MIPS: BMIPS: brcmstb: add I2C node for bcm7362

 arch/mips/boot/dts/brcm/bcm7346.dtsi      | 72 ++++++++++++++++++++++++++++++-
 arch/mips/boot/dts/brcm/bcm7358.dtsi      | 62 +++++++++++++++++++++++++-
 arch/mips/boot/dts/brcm/bcm7360.dtsi      | 62 +++++++++++++++++++++++++-
 arch/mips/boot/dts/brcm/bcm7362.dtsi      | 52 +++++++++++++++++++++-
 arch/mips/boot/dts/brcm/bcm97346dbsmb.dts | 20 +++++++++
 arch/mips/boot/dts/brcm/bcm97358svmb.dts  | 16 +++++++
 arch/mips/boot/dts/brcm/bcm97360svmb.dts  | 16 +++++++
 arch/mips/boot/dts/brcm/bcm97362svmb.dts  | 12 ++++++
 drivers/i2c/busses/Kconfig                |  2 +-
 drivers/i2c/busses/i2c-brcmstb.c          | 11 +++--
 10 files changed, 310 insertions(+), 15 deletions(-)

-- 
2.6.1

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

* [PATCH 1/9] i2c: brcmstb: make the driver buildable on BMIPS_GENERIC
  2015-10-21  2:36 ` Jaedon Shin
  (?)
@ 2015-10-21  2:36 ` Jaedon Shin
  2015-10-22  1:56   ` Florian Fainelli
  -1 siblings, 1 reply; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:36 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c, devicetree, linux-mips, Jaedon Shin

The BCM7xxx ARM and MIPS platforms share a similar hardware block for
I2C.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 drivers/i2c/busses/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 08b86178e8fb..fd983c5b36f2 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -394,7 +394,7 @@ config I2C_BCM_KONA
 
 config I2C_BRCMSTB
 	tristate "BRCM Settop I2C controller"
-	depends on ARCH_BRCMSTB || COMPILE_TEST
+	depends on ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
 	default y
 	help
 	  If you say yes to this option, support will be included for the
-- 
2.6.1

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

* [PATCH 2/9] i2c: brcmstb: fix typo in i2c-brcmstb
  2015-10-21  2:36 ` Jaedon Shin
@ 2015-10-21  2:36     ` Jaedon Shin
  -1 siblings, 0 replies; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:36 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA, Jaedon Shin

Fixes the "definitions" where it is spelled "defintions".

Signed-off-by: Jaedon Shin <jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/i2c/busses/i2c-brcmstb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index 8e9637eea512..6b8bbf99880d 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -41,7 +41,7 @@
 #define BSC_CTL_REG_INT_EN_SHIFT			6
 #define BSC_CTL_REG_DIV_CLK_MASK			0x00000080
 
-/* BSC_IIC_ENABLE r/w enable and interrupt field defintions */
+/* BSC_IIC_ENABLE r/w enable and interrupt field definitions */
 #define BSC_IIC_EN_RESTART_MASK				0x00000040
 #define BSC_IIC_EN_NOSTART_MASK				0x00000020
 #define BSC_IIC_EN_NOSTOP_MASK				0x00000010
-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 2/9] i2c: brcmstb: fix typo in i2c-brcmstb
@ 2015-10-21  2:36     ` Jaedon Shin
  0 siblings, 0 replies; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:36 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c, devicetree, linux-mips, Jaedon Shin

Fixes the "definitions" where it is spelled "defintions".

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 drivers/i2c/busses/i2c-brcmstb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index 8e9637eea512..6b8bbf99880d 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -41,7 +41,7 @@
 #define BSC_CTL_REG_INT_EN_SHIFT			6
 #define BSC_CTL_REG_DIV_CLK_MASK			0x00000080
 
-/* BSC_IIC_ENABLE r/w enable and interrupt field defintions */
+/* BSC_IIC_ENABLE r/w enable and interrupt field definitions */
 #define BSC_IIC_EN_RESTART_MASK				0x00000040
 #define BSC_IIC_EN_NOSTART_MASK				0x00000020
 #define BSC_IIC_EN_NOSTOP_MASK				0x00000010
-- 
2.6.1

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

* [PATCH 3/9] i2c: brcmstb: add missing parenthesis
  2015-10-21  2:36 ` Jaedon Shin
  (?)
  (?)
@ 2015-10-21  2:36 ` Jaedon Shin
  2015-10-22  1:56   ` Florian Fainelli
  -1 siblings, 1 reply; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:36 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c, devicetree, linux-mips, Jaedon Shin

Add the necessary parenthesis for NOACK condition.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 drivers/i2c/busses/i2c-brcmstb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index 6b8bbf99880d..2d7d155029dc 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -305,7 +305,7 @@ static int brcmstb_send_i2c_cmd(struct brcmstb_i2c_dev *dev,
 	}
 
 	if ((CMD_RD || CMD_WR) &&
-	    bsc_readl(dev, iic_enable) & BSC_IIC_EN_NOACK_MASK) {
+	    (bsc_readl(dev, iic_enable) & BSC_IIC_EN_NOACK_MASK)) {
 		rc = -EREMOTEIO;
 		dev_dbg(dev->device, "controller received NOACK intr for %s\n",
 			cmd_string[cmd]);
-- 
2.6.1

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

* [PATCH 4/9] i2c: brcmstb: enable ACK condition
  2015-10-21  2:36 ` Jaedon Shin
                   ` (2 preceding siblings ...)
  (?)
@ 2015-10-21  2:36 ` Jaedon Shin
  2015-11-30 15:37   ` Wolfram Sang
  -1 siblings, 1 reply; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:36 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c, devicetree, linux-mips, Jaedon Shin

Removes the condition of a message with under 32 bytes in length. The
messages that do not require an ACK are I2C_M_IGNORE_NAK flag.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 drivers/i2c/busses/i2c-brcmstb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index 2d7d155029dc..53eb8b0c9bad 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -330,7 +330,7 @@ static int brcmstb_i2c_xfer_bsc_data(struct brcmstb_i2c_dev *dev,
 	int no_ack = pmsg->flags & I2C_M_IGNORE_NAK;
 
 	/* see if the transaction needs to check NACK conditions */
-	if (no_ack || len <= N_DATA_BYTES) {
+	if (no_ack) {
 		cmd = (pmsg->flags & I2C_M_RD) ? CMD_RD_NOACK
 			: CMD_WR_NOACK;
 		pi2creg->ctlhi_reg |= BSC_CTLHI_REG_IGNORE_ACK_MASK;
-- 
2.6.1

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

* [PATCH 5/9] i2c: brcmstb: fix start and stop conditions
  2015-10-21  2:36 ` Jaedon Shin
@ 2015-10-21  2:36     ` Jaedon Shin
  -1 siblings, 0 replies; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:36 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA, Jaedon Shin

Fixes conditions for RESTART, NOSTART and NOSTOP. The masks of start and
stop is already in brcmstb_set_i2c_start_stop(). Therefore, the caller
does not need a mask value.

Signed-off-by: Jaedon Shin <jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/i2c/busses/i2c-brcmstb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index 53eb8b0c9bad..dcd1209f843f 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -464,7 +464,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter,
 			pmsg->buf ? pmsg->buf[0] : '0', pmsg->len);
 
 		if (i < (num - 1) && (msgs[i + 1].flags & I2C_M_NOSTART))
-			brcmstb_set_i2c_start_stop(dev, ~(COND_START_STOP));
+			brcmstb_set_i2c_start_stop(dev, 0);
 		else
 			brcmstb_set_i2c_start_stop(dev,
 						   COND_RESTART | COND_NOSTOP);
@@ -485,8 +485,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter,
 			bytes_to_xfer = min(len, N_DATA_BYTES);
 
 			if (len <= N_DATA_BYTES && i == (num - 1))
-				brcmstb_set_i2c_start_stop(dev,
-							   ~(COND_START_STOP));
+				brcmstb_set_i2c_start_stop(dev, 0);
 
 			rc = brcmstb_i2c_xfer_bsc_data(dev, tmp_buf,
 						       bytes_to_xfer, pmsg);
-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 5/9] i2c: brcmstb: fix start and stop conditions
@ 2015-10-21  2:36     ` Jaedon Shin
  0 siblings, 0 replies; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:36 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c, devicetree, linux-mips, Jaedon Shin

Fixes conditions for RESTART, NOSTART and NOSTOP. The masks of start and
stop is already in brcmstb_set_i2c_start_stop(). Therefore, the caller
does not need a mask value.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 drivers/i2c/busses/i2c-brcmstb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index 53eb8b0c9bad..dcd1209f843f 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -464,7 +464,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter,
 			pmsg->buf ? pmsg->buf[0] : '0', pmsg->len);
 
 		if (i < (num - 1) && (msgs[i + 1].flags & I2C_M_NOSTART))
-			brcmstb_set_i2c_start_stop(dev, ~(COND_START_STOP));
+			brcmstb_set_i2c_start_stop(dev, 0);
 		else
 			brcmstb_set_i2c_start_stop(dev,
 						   COND_RESTART | COND_NOSTOP);
@@ -485,8 +485,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter,
 			bytes_to_xfer = min(len, N_DATA_BYTES);
 
 			if (len <= N_DATA_BYTES && i == (num - 1))
-				brcmstb_set_i2c_start_stop(dev,
-							   ~(COND_START_STOP));
+				brcmstb_set_i2c_start_stop(dev, 0);
 
 			rc = brcmstb_i2c_xfer_bsc_data(dev, tmp_buf,
 						       bytes_to_xfer, pmsg);
-- 
2.6.1

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

* [PATCH 6/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7346
  2015-10-21  2:36 ` Jaedon Shin
@ 2015-10-21  2:36     ` Jaedon Shin
  -1 siblings, 0 replies; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:36 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA, Jaedon Shin

Add I2C device nodes to BMIPS based BCM7346 platform.

Signed-off-by: Jaedon Shin <jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 arch/mips/boot/dts/brcm/bcm7346.dtsi      | 72 ++++++++++++++++++++++++++++++-
 arch/mips/boot/dts/brcm/bcm97346dbsmb.dts | 20 +++++++++
 2 files changed, 90 insertions(+), 2 deletions(-)

diff --git a/arch/mips/boot/dts/brcm/bcm7346.dtsi b/arch/mips/boot/dts/brcm/bcm7346.dtsi
index d817bb46b934..0a1927099075 100644
--- a/arch/mips/boot/dts/brcm/bcm7346.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm7346.dtsi
@@ -87,14 +87,32 @@
 			compatible = "brcm,bcm7120-l2-intc";
 			reg = <0x406780 0x8>;
 
-			brcm,int-map-mask = <0x44>;
+			brcm,int-map-mask = <0x44>, <0xf000000>;
 			brcm,int-fwd-mask = <0x70000>;
 
 			interrupt-controller;
 			#interrupt-cells = <1>;
 
 			interrupt-parent = <&periph_intc>;
-			interrupts = <59>;
+			interrupts = <59>, <57>;
+			interrupt-names = "upg_main", "upg_bsc";
+		};
+
+		upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 {
+			compatible = "brcm,bcm7120-l2-intc";
+			reg = <0x408b80 0x8>;
+
+			brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>;
+			brcm,int-fwd-mask = <0>;
+			brcm,irq-can-wake;
+
+			interrupt-controller;
+			#interrupt-cells = <1>;
+
+			interrupt-parent = <&periph_intc>;
+			interrupts = <60>, <58>, <62>;
+			interrupt-names = "upg_main_aon", "upg_bsc_aon",
+					  "upg_spi";
 		};
 
 		sun_top_ctrl: syscon@404000 {
@@ -144,6 +162,56 @@
 			status = "disabled";
 		};
 
+		bsca: i2c@406200 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406200 0x58>;
+		      interrupts = <24>;
+		      interrupt-names = "upg_bsca";
+		      status = "disabled";
+		};
+
+		bscb: i2c@406280 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406280 0x58>;
+		      interrupts = <25>;
+		      interrupt-names = "upg_bscb";
+		      status = "disabled";
+		};
+
+		bscc: i2c@406300 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406300 0x58>;
+		      interrupts = <26>;
+		      interrupt-names = "upg_bscc";
+		      status = "disabled";
+		};
+
+		bscd: i2c@406380 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406380 0x58>;
+		      interrupts = <27>;
+		      interrupt-names = "upg_bscd";
+		      status = "disabled";
+		};
+
+		bsce: i2c@408980 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_aon_irq0_intc>;
+		      reg = <0x408980 0x58>;
+		      interrupts = <27>;
+		      interrupt-names = "upg_bsce";
+		      status = "disabled";
+		};
+
 		enet0: ethernet@430000 {
 			phy-mode = "internal";
 			phy-handle = <&phy1>;
diff --git a/arch/mips/boot/dts/brcm/bcm97346dbsmb.dts b/arch/mips/boot/dts/brcm/bcm97346dbsmb.dts
index 3fe0445b9d37..a5b6365afc5f 100644
--- a/arch/mips/boot/dts/brcm/bcm97346dbsmb.dts
+++ b/arch/mips/boot/dts/brcm/bcm97346dbsmb.dts
@@ -29,6 +29,26 @@
 	status = "okay";
 };
 
+&bsca {
+	status = "okay";
+};
+
+&bscb {
+	status = "okay";
+};
+
+&bscc {
+	status = "okay";
+};
+
+&bscd {
+	status = "okay";
+};
+
+&bsce {
+	status = "okay";
+};
+
 &enet0 {
 	status = "okay";
 };
-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 6/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7346
@ 2015-10-21  2:36     ` Jaedon Shin
  0 siblings, 0 replies; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:36 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c, devicetree, linux-mips, Jaedon Shin

Add I2C device nodes to BMIPS based BCM7346 platform.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 arch/mips/boot/dts/brcm/bcm7346.dtsi      | 72 ++++++++++++++++++++++++++++++-
 arch/mips/boot/dts/brcm/bcm97346dbsmb.dts | 20 +++++++++
 2 files changed, 90 insertions(+), 2 deletions(-)

diff --git a/arch/mips/boot/dts/brcm/bcm7346.dtsi b/arch/mips/boot/dts/brcm/bcm7346.dtsi
index d817bb46b934..0a1927099075 100644
--- a/arch/mips/boot/dts/brcm/bcm7346.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm7346.dtsi
@@ -87,14 +87,32 @@
 			compatible = "brcm,bcm7120-l2-intc";
 			reg = <0x406780 0x8>;
 
-			brcm,int-map-mask = <0x44>;
+			brcm,int-map-mask = <0x44>, <0xf000000>;
 			brcm,int-fwd-mask = <0x70000>;
 
 			interrupt-controller;
 			#interrupt-cells = <1>;
 
 			interrupt-parent = <&periph_intc>;
-			interrupts = <59>;
+			interrupts = <59>, <57>;
+			interrupt-names = "upg_main", "upg_bsc";
+		};
+
+		upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 {
+			compatible = "brcm,bcm7120-l2-intc";
+			reg = <0x408b80 0x8>;
+
+			brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>;
+			brcm,int-fwd-mask = <0>;
+			brcm,irq-can-wake;
+
+			interrupt-controller;
+			#interrupt-cells = <1>;
+
+			interrupt-parent = <&periph_intc>;
+			interrupts = <60>, <58>, <62>;
+			interrupt-names = "upg_main_aon", "upg_bsc_aon",
+					  "upg_spi";
 		};
 
 		sun_top_ctrl: syscon@404000 {
@@ -144,6 +162,56 @@
 			status = "disabled";
 		};
 
+		bsca: i2c@406200 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406200 0x58>;
+		      interrupts = <24>;
+		      interrupt-names = "upg_bsca";
+		      status = "disabled";
+		};
+
+		bscb: i2c@406280 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406280 0x58>;
+		      interrupts = <25>;
+		      interrupt-names = "upg_bscb";
+		      status = "disabled";
+		};
+
+		bscc: i2c@406300 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406300 0x58>;
+		      interrupts = <26>;
+		      interrupt-names = "upg_bscc";
+		      status = "disabled";
+		};
+
+		bscd: i2c@406380 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406380 0x58>;
+		      interrupts = <27>;
+		      interrupt-names = "upg_bscd";
+		      status = "disabled";
+		};
+
+		bsce: i2c@408980 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_aon_irq0_intc>;
+		      reg = <0x408980 0x58>;
+		      interrupts = <27>;
+		      interrupt-names = "upg_bsce";
+		      status = "disabled";
+		};
+
 		enet0: ethernet@430000 {
 			phy-mode = "internal";
 			phy-handle = <&phy1>;
diff --git a/arch/mips/boot/dts/brcm/bcm97346dbsmb.dts b/arch/mips/boot/dts/brcm/bcm97346dbsmb.dts
index 3fe0445b9d37..a5b6365afc5f 100644
--- a/arch/mips/boot/dts/brcm/bcm97346dbsmb.dts
+++ b/arch/mips/boot/dts/brcm/bcm97346dbsmb.dts
@@ -29,6 +29,26 @@
 	status = "okay";
 };
 
+&bsca {
+	status = "okay";
+};
+
+&bscb {
+	status = "okay";
+};
+
+&bscc {
+	status = "okay";
+};
+
+&bscd {
+	status = "okay";
+};
+
+&bsce {
+	status = "okay";
+};
+
 &enet0 {
 	status = "okay";
 };
-- 
2.6.1

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

* [PATCH 7/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7358
  2015-10-21  2:36 ` Jaedon Shin
                   ` (4 preceding siblings ...)
  (?)
@ 2015-10-21  2:36 ` Jaedon Shin
  2015-10-22  1:57   ` Florian Fainelli
  -1 siblings, 1 reply; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:36 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c, devicetree, linux-mips, Jaedon Shin

Add I2C device nodes to BMIPS based BCM7358 platform.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 arch/mips/boot/dts/brcm/bcm7358.dtsi     | 62 ++++++++++++++++++++++++++++++--
 arch/mips/boot/dts/brcm/bcm97358svmb.dts | 16 +++++++++
 2 files changed, 76 insertions(+), 2 deletions(-)

diff --git a/arch/mips/boot/dts/brcm/bcm7358.dtsi b/arch/mips/boot/dts/brcm/bcm7358.dtsi
index 277a90adc1a7..8e2501694d03 100644
--- a/arch/mips/boot/dts/brcm/bcm7358.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm7358.dtsi
@@ -81,14 +81,32 @@
 			compatible = "brcm,bcm7120-l2-intc";
 			reg = <0x406600 0x8>;
 
-			brcm,int-map-mask = <0x44>;
+			brcm,int-map-mask = <0x44>, <0x7000000>;
 			brcm,int-fwd-mask = <0x70000>;
 
 			interrupt-controller;
 			#interrupt-cells = <1>;
 
 			interrupt-parent = <&periph_intc>;
-			interrupts = <56>;
+			interrupts = <56>, <54>;
+			interrupt-names = "upg_main", "upg_bsc";
+		};
+
+		upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 {
+			compatible = "brcm,bcm7120-l2-intc";
+			reg = <0x408b80 0x8>;
+
+			brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>;
+			brcm,int-fwd-mask = <0>;
+			brcm,irq-can-wake;
+
+			interrupt-controller;
+			#interrupt-cells = <1>;
+
+			interrupt-parent = <&periph_intc>;
+			interrupts = <57>, <55>, <59>;
+			interrupt-names = "upg_main_aon", "upg_bsc_aon",
+					  "upg_spi";
 		};
 
 		sun_top_ctrl: syscon@404000 {
@@ -138,6 +156,46 @@
 			status = "disabled";
 		};
 
+		bsca: i2c@406200 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406200 0x58>;
+		      interrupts = <24>;
+		      interrupt-names = "upg_bsca";
+		      status = "disabled";
+		};
+
+		bscb: i2c@406280 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406280 0x58>;
+		      interrupts = <25>;
+		      interrupt-names = "upg_bscb";
+		      status = "disabled";
+		};
+
+		bscc: i2c@406300 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406300 0x58>;
+		      interrupts = <26>;
+		      interrupt-names = "upg_bscc";
+		      status = "disabled";
+		};
+
+		bscd: i2c@408980 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_aon_irq0_intc>;
+		      reg = <0x408980 0x58>;
+		      interrupts = <27>;
+		      interrupt-names = "upg_bscd";
+		      status = "disabled";
+		};
+
 		enet0: ethernet@430000 {
 			phy-mode = "internal";
 			phy-handle = <&phy1>;
diff --git a/arch/mips/boot/dts/brcm/bcm97358svmb.dts b/arch/mips/boot/dts/brcm/bcm97358svmb.dts
index a8dc01e30313..02ce6b429dc4 100644
--- a/arch/mips/boot/dts/brcm/bcm97358svmb.dts
+++ b/arch/mips/boot/dts/brcm/bcm97358svmb.dts
@@ -29,6 +29,22 @@
 	status = "okay";
 };
 
+&bsca {
+	status = "okay";
+};
+
+&bscb {
+	status = "okay";
+};
+
+&bscc {
+	status = "okay";
+};
+
+&bscd {
+	status = "okay";
+};
+
 &enet0 {
 	status = "okay";
 };
-- 
2.6.1

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

* [PATCH 8/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7360
  2015-10-21  2:36 ` Jaedon Shin
                   ` (5 preceding siblings ...)
  (?)
@ 2015-10-21  2:37 ` Jaedon Shin
  2015-10-22  1:57   ` Florian Fainelli
  -1 siblings, 1 reply; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:37 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c, devicetree, linux-mips, Jaedon Shin

Add I2C device nodes to BMIPS based BCM7360 platform.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 arch/mips/boot/dts/brcm/bcm7360.dtsi     | 62 ++++++++++++++++++++++++++++++--
 arch/mips/boot/dts/brcm/bcm97360svmb.dts | 16 +++++++++
 2 files changed, 76 insertions(+), 2 deletions(-)

diff --git a/arch/mips/boot/dts/brcm/bcm7360.dtsi b/arch/mips/boot/dts/brcm/bcm7360.dtsi
index 9e1e571ba346..7e5f76040fb8 100644
--- a/arch/mips/boot/dts/brcm/bcm7360.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm7360.dtsi
@@ -81,14 +81,32 @@
 			compatible = "brcm,bcm7120-l2-intc";
 			reg = <0x406600 0x8>;
 
-			brcm,int-map-mask = <0x44>;
+			brcm,int-map-mask = <0x44>, <0x7000000>;
 			brcm,int-fwd-mask = <0x70000>;
 
 			interrupt-controller;
 			#interrupt-cells = <1>;
 
 			interrupt-parent = <&periph_intc>;
-			interrupts = <56>;
+			interrupts = <56>, <54>;
+			interrupt-names = "upg_main", "upg_bsc";
+		};
+
+		upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 {
+			compatible = "brcm,bcm7120-l2-intc";
+			reg = <0x408b80 0x8>;
+
+			brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>;
+			brcm,int-fwd-mask = <0>;
+			brcm,irq-can-wake;
+
+			interrupt-controller;
+			#interrupt-cells = <1>;
+
+			interrupt-parent = <&periph_intc>;
+			interrupts = <57>, <55>, <59>;
+			interrupt-names = "upg_main_aon", "upg_bsc_aon",
+					  "upg_spi";
 		};
 
 		sun_top_ctrl: syscon@404000 {
@@ -138,6 +156,46 @@
 			status = "disabled";
 		};
 
+		bsca: i2c@406200 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406200 0x58>;
+		      interrupts = <24>;
+		      interrupt-names = "upg_bsca";
+		      status = "disabled";
+		};
+
+		bscb: i2c@406280 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406280 0x58>;
+		      interrupts = <25>;
+		      interrupt-names = "upg_bscb";
+		      status = "disabled";
+		};
+
+		bscc: i2c@406300 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406300 0x58>;
+		      interrupts = <26>;
+		      interrupt-names = "upg_bscc";
+		      status = "disabled";
+		};
+
+		bscd: i2c@408980 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_aon_irq0_intc>;
+		      reg = <0x408980 0x58>;
+		      interrupts = <27>;
+		      interrupt-names = "upg_bscd";
+		      status = "disabled";
+		};
+
 		enet0: ethernet@430000 {
 			phy-mode = "internal";
 			phy-handle = <&phy1>;
diff --git a/arch/mips/boot/dts/brcm/bcm97360svmb.dts b/arch/mips/boot/dts/brcm/bcm97360svmb.dts
index eee8b0e32681..d48462e091f1 100644
--- a/arch/mips/boot/dts/brcm/bcm97360svmb.dts
+++ b/arch/mips/boot/dts/brcm/bcm97360svmb.dts
@@ -29,6 +29,22 @@
 	status = "okay";
 };
 
+&bsca {
+	status = "okay";
+};
+
+&bscb {
+	status = "okay";
+};
+
+&bscc {
+	status = "okay";
+};
+
+&bscd {
+	status = "okay";
+};
+
 &enet0 {
 	status = "okay";
 };
-- 
2.6.1

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

* [PATCH 9/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7362
  2015-10-21  2:36 ` Jaedon Shin
                   ` (6 preceding siblings ...)
  (?)
@ 2015-10-21  2:37 ` Jaedon Shin
  2015-10-22  1:57   ` Florian Fainelli
  -1 siblings, 1 reply; 28+ messages in thread
From: Jaedon Shin @ 2015-10-21  2:37 UTC (permalink / raw)
  To: Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: Florian Fainelli, linux-i2c, devicetree, linux-mips, Jaedon Shin

Add I2C device nodes to BMIPS based BCM7362 platform.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
---
 arch/mips/boot/dts/brcm/bcm7362.dtsi     | 52 ++++++++++++++++++++++++++++++--
 arch/mips/boot/dts/brcm/bcm97362svmb.dts | 12 ++++++++
 2 files changed, 62 insertions(+), 2 deletions(-)

diff --git a/arch/mips/boot/dts/brcm/bcm7362.dtsi b/arch/mips/boot/dts/brcm/bcm7362.dtsi
index 6e65db86fc61..5f817be2553c 100644
--- a/arch/mips/boot/dts/brcm/bcm7362.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm7362.dtsi
@@ -87,14 +87,32 @@
 			compatible = "brcm,bcm7120-l2-intc";
 			reg = <0x406600 0x8>;
 
-			brcm,int-map-mask = <0x44>;
+			brcm,int-map-mask = <0x44>, <0x7000000>;
 			brcm,int-fwd-mask = <0x70000>;
 
 			interrupt-controller;
 			#interrupt-cells = <1>;
 
 			interrupt-parent = <&periph_intc>;
-			interrupts = <56>;
+			interrupts = <56>, <54>;
+			interrupt-names = "upg_main", "upg_bsc";
+		};
+
+		upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 {
+			compatible = "brcm,bcm7120-l2-intc";
+			reg = <0x408b80 0x8>;
+
+			brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>;
+			brcm,int-fwd-mask = <0>;
+			brcm,irq-can-wake;
+
+			interrupt-controller;
+			#interrupt-cells = <1>;
+
+			interrupt-parent = <&periph_intc>;
+			interrupts = <57>, <55>, <59>;
+			interrupt-names = "upg_main_aon", "upg_bsc_aon",
+					  "upg_spi";
 		};
 
 		sun_top_ctrl: syscon@404000 {
@@ -144,6 +162,36 @@
 			status = "disabled";
 		};
 
+		bsca: i2c@406200 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406200 0x58>;
+		      interrupts = <24>;
+		      interrupt-names = "upg_bsca";
+		      status = "disabled";
+		};
+
+		bscb: i2c@406280 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_irq0_intc>;
+		      reg = <0x406280 0x58>;
+		      interrupts = <25>;
+		      interrupt-names = "upg_bscb";
+		      status = "disabled";
+		};
+
+		bscd: i2c@408980 {
+		      clock-frequency = <390000>;
+		      compatible = "brcm,brcmstb-i2c";
+		      interrupt-parent = <&upg_aon_irq0_intc>;
+		      reg = <0x408980 0x58>;
+		      interrupts = <27>;
+		      interrupt-names = "upg_bscd";
+		      status = "disabled";
+		};
+
 		enet0: ethernet@430000 {
 			phy-mode = "internal";
 			phy-handle = <&phy1>;
diff --git a/arch/mips/boot/dts/brcm/bcm97362svmb.dts b/arch/mips/boot/dts/brcm/bcm97362svmb.dts
index 739c2ef5663b..9c99bfd1e781 100644
--- a/arch/mips/boot/dts/brcm/bcm97362svmb.dts
+++ b/arch/mips/boot/dts/brcm/bcm97362svmb.dts
@@ -29,6 +29,18 @@
 	status = "okay";
 };
 
+&bsca {
+	status = "okay";
+};
+
+&bscb {
+	status = "okay";
+};
+
+&bscd {
+	status = "okay";
+};
+
 &enet0 {
 	status = "okay";
 };
-- 
2.6.1

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

* Re: [PATCH 1/9] i2c: brcmstb: make the driver buildable on BMIPS_GENERIC
  2015-10-21  2:36 ` [PATCH 1/9] i2c: brcmstb: make the driver buildable on BMIPS_GENERIC Jaedon Shin
@ 2015-10-22  1:56   ` Florian Fainelli
  0 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2015-10-22  1:56 UTC (permalink / raw)
  To: Jaedon Shin, Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: linux-i2c, devicetree, linux-mips

Le 20/10/2015 19:36, Jaedon Shin a écrit :
> The BCM7xxx ARM and MIPS platforms share a similar hardware block for
> I2C.
> 
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  drivers/i2c/busses/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> index 08b86178e8fb..fd983c5b36f2 100644
> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -394,7 +394,7 @@ config I2C_BCM_KONA
>  
>  config I2C_BRCMSTB
>  	tristate "BRCM Settop I2C controller"
> -	depends on ARCH_BRCMSTB || COMPILE_TEST
> +	depends on ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
>  	default y
>  	help
>  	  If you say yes to this option, support will be included for the
> 


-- 
Florian

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

* Re: [PATCH 2/9] i2c: brcmstb: fix typo in i2c-brcmstb
  2015-10-21  2:36     ` Jaedon Shin
  (?)
@ 2015-10-22  1:56     ` Florian Fainelli
  -1 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2015-10-22  1:56 UTC (permalink / raw)
  To: Jaedon Shin, Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: linux-i2c, devicetree, linux-mips

Le 20/10/2015 19:36, Jaedon Shin a écrit :
> Fixes the "definitions" where it is spelled "defintions".
> 
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  drivers/i2c/busses/i2c-brcmstb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
> index 8e9637eea512..6b8bbf99880d 100644
> --- a/drivers/i2c/busses/i2c-brcmstb.c
> +++ b/drivers/i2c/busses/i2c-brcmstb.c
> @@ -41,7 +41,7 @@
>  #define BSC_CTL_REG_INT_EN_SHIFT			6
>  #define BSC_CTL_REG_DIV_CLK_MASK			0x00000080
>  
> -/* BSC_IIC_ENABLE r/w enable and interrupt field defintions */
> +/* BSC_IIC_ENABLE r/w enable and interrupt field definitions */
>  #define BSC_IIC_EN_RESTART_MASK				0x00000040
>  #define BSC_IIC_EN_NOSTART_MASK				0x00000020
>  #define BSC_IIC_EN_NOSTOP_MASK				0x00000010
> 


-- 
Florian

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

* Re: [PATCH 3/9] i2c: brcmstb: add missing parenthesis
  2015-10-21  2:36 ` [PATCH 3/9] i2c: brcmstb: add missing parenthesis Jaedon Shin
@ 2015-10-22  1:56   ` Florian Fainelli
  2015-11-30 15:36     ` Wolfram Sang
  0 siblings, 1 reply; 28+ messages in thread
From: Florian Fainelli @ 2015-10-22  1:56 UTC (permalink / raw)
  To: Jaedon Shin, Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: linux-i2c, devicetree, linux-mips

Le 20/10/2015 19:36, Jaedon Shin a écrit :
> Add the necessary parenthesis for NOACK condition.
> 
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  drivers/i2c/busses/i2c-brcmstb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
> index 6b8bbf99880d..2d7d155029dc 100644
> --- a/drivers/i2c/busses/i2c-brcmstb.c
> +++ b/drivers/i2c/busses/i2c-brcmstb.c
> @@ -305,7 +305,7 @@ static int brcmstb_send_i2c_cmd(struct brcmstb_i2c_dev *dev,
>  	}
>  
>  	if ((CMD_RD || CMD_WR) &&
> -	    bsc_readl(dev, iic_enable) & BSC_IIC_EN_NOACK_MASK) {
> +	    (bsc_readl(dev, iic_enable) & BSC_IIC_EN_NOACK_MASK)) {
>  		rc = -EREMOTEIO;
>  		dev_dbg(dev->device, "controller received NOACK intr for %s\n",
>  			cmd_string[cmd]);
> 


-- 
Florian

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

* Re: [PATCH 6/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7346
  2015-10-21  2:36     ` Jaedon Shin
@ 2015-10-22  1:57         ` Florian Fainelli
  -1 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2015-10-22  1:57 UTC (permalink / raw)
  To: Jaedon Shin, Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA

Le 20/10/2015 19:36, Jaedon Shin a écrit :
> Add I2C device nodes to BMIPS based BCM7346 platform.
> 
> Signed-off-by: Jaedon Shin <jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Acked-by: Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
-- 
Florian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 6/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7346
@ 2015-10-22  1:57         ` Florian Fainelli
  0 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2015-10-22  1:57 UTC (permalink / raw)
  To: Jaedon Shin, Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: linux-i2c, devicetree, linux-mips

Le 20/10/2015 19:36, Jaedon Shin a écrit :
> Add I2C device nodes to BMIPS based BCM7346 platform.
> 
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH 7/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7358
  2015-10-21  2:36 ` [PATCH 7/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7358 Jaedon Shin
@ 2015-10-22  1:57   ` Florian Fainelli
  0 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2015-10-22  1:57 UTC (permalink / raw)
  To: Jaedon Shin, Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: linux-i2c, devicetree, linux-mips

Le 20/10/2015 19:36, Jaedon Shin a écrit :
> Add I2C device nodes to BMIPS based BCM7358 platform.
> 
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  arch/mips/boot/dts/brcm/bcm7358.dtsi     | 62 ++++++++++++++++++++++++++++++--
>  arch/mips/boot/dts/brcm/bcm97358svmb.dts | 16 +++++++++
>  2 files changed, 76 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/boot/dts/brcm/bcm7358.dtsi b/arch/mips/boot/dts/brcm/bcm7358.dtsi
> index 277a90adc1a7..8e2501694d03 100644
> --- a/arch/mips/boot/dts/brcm/bcm7358.dtsi
> +++ b/arch/mips/boot/dts/brcm/bcm7358.dtsi
> @@ -81,14 +81,32 @@
>  			compatible = "brcm,bcm7120-l2-intc";
>  			reg = <0x406600 0x8>;
>  
> -			brcm,int-map-mask = <0x44>;
> +			brcm,int-map-mask = <0x44>, <0x7000000>;
>  			brcm,int-fwd-mask = <0x70000>;
>  
>  			interrupt-controller;
>  			#interrupt-cells = <1>;
>  
>  			interrupt-parent = <&periph_intc>;
> -			interrupts = <56>;
> +			interrupts = <56>, <54>;
> +			interrupt-names = "upg_main", "upg_bsc";
> +		};
> +
> +		upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 {
> +			compatible = "brcm,bcm7120-l2-intc";
> +			reg = <0x408b80 0x8>;
> +
> +			brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>;
> +			brcm,int-fwd-mask = <0>;
> +			brcm,irq-can-wake;
> +
> +			interrupt-controller;
> +			#interrupt-cells = <1>;
> +
> +			interrupt-parent = <&periph_intc>;
> +			interrupts = <57>, <55>, <59>;
> +			interrupt-names = "upg_main_aon", "upg_bsc_aon",
> +					  "upg_spi";
>  		};
>  
>  		sun_top_ctrl: syscon@404000 {
> @@ -138,6 +156,46 @@
>  			status = "disabled";
>  		};
>  
> +		bsca: i2c@406200 {
> +		      clock-frequency = <390000>;
> +		      compatible = "brcm,brcmstb-i2c";
> +		      interrupt-parent = <&upg_irq0_intc>;
> +		      reg = <0x406200 0x58>;
> +		      interrupts = <24>;
> +		      interrupt-names = "upg_bsca";
> +		      status = "disabled";
> +		};
> +
> +		bscb: i2c@406280 {
> +		      clock-frequency = <390000>;
> +		      compatible = "brcm,brcmstb-i2c";
> +		      interrupt-parent = <&upg_irq0_intc>;
> +		      reg = <0x406280 0x58>;
> +		      interrupts = <25>;
> +		      interrupt-names = "upg_bscb";
> +		      status = "disabled";
> +		};
> +
> +		bscc: i2c@406300 {
> +		      clock-frequency = <390000>;
> +		      compatible = "brcm,brcmstb-i2c";
> +		      interrupt-parent = <&upg_irq0_intc>;
> +		      reg = <0x406300 0x58>;
> +		      interrupts = <26>;
> +		      interrupt-names = "upg_bscc";
> +		      status = "disabled";
> +		};
> +
> +		bscd: i2c@408980 {
> +		      clock-frequency = <390000>;
> +		      compatible = "brcm,brcmstb-i2c";
> +		      interrupt-parent = <&upg_aon_irq0_intc>;
> +		      reg = <0x408980 0x58>;
> +		      interrupts = <27>;
> +		      interrupt-names = "upg_bscd";
> +		      status = "disabled";
> +		};
> +
>  		enet0: ethernet@430000 {
>  			phy-mode = "internal";
>  			phy-handle = <&phy1>;
> diff --git a/arch/mips/boot/dts/brcm/bcm97358svmb.dts b/arch/mips/boot/dts/brcm/bcm97358svmb.dts
> index a8dc01e30313..02ce6b429dc4 100644
> --- a/arch/mips/boot/dts/brcm/bcm97358svmb.dts
> +++ b/arch/mips/boot/dts/brcm/bcm97358svmb.dts
> @@ -29,6 +29,22 @@
>  	status = "okay";
>  };
>  
> +&bsca {
> +	status = "okay";
> +};
> +
> +&bscb {
> +	status = "okay";
> +};
> +
> +&bscc {
> +	status = "okay";
> +};
> +
> +&bscd {
> +	status = "okay";
> +};
> +
>  &enet0 {
>  	status = "okay";
>  };
> 


-- 
Florian

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

* Re: [PATCH 8/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7360
  2015-10-21  2:37 ` [PATCH 8/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7360 Jaedon Shin
@ 2015-10-22  1:57   ` Florian Fainelli
  0 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2015-10-22  1:57 UTC (permalink / raw)
  To: Jaedon Shin, Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: linux-i2c, devicetree, linux-mips

Le 20/10/2015 19:37, Jaedon Shin a écrit :
> Add I2C device nodes to BMIPS based BCM7360 platform.
> 
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  arch/mips/boot/dts/brcm/bcm7360.dtsi     | 62 ++++++++++++++++++++++++++++++--
>  arch/mips/boot/dts/brcm/bcm97360svmb.dts | 16 +++++++++
>  2 files changed, 76 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/boot/dts/brcm/bcm7360.dtsi b/arch/mips/boot/dts/brcm/bcm7360.dtsi
> index 9e1e571ba346..7e5f76040fb8 100644
> --- a/arch/mips/boot/dts/brcm/bcm7360.dtsi
> +++ b/arch/mips/boot/dts/brcm/bcm7360.dtsi
> @@ -81,14 +81,32 @@
>  			compatible = "brcm,bcm7120-l2-intc";
>  			reg = <0x406600 0x8>;
>  
> -			brcm,int-map-mask = <0x44>;
> +			brcm,int-map-mask = <0x44>, <0x7000000>;
>  			brcm,int-fwd-mask = <0x70000>;
>  
>  			interrupt-controller;
>  			#interrupt-cells = <1>;
>  
>  			interrupt-parent = <&periph_intc>;
> -			interrupts = <56>;
> +			interrupts = <56>, <54>;
> +			interrupt-names = "upg_main", "upg_bsc";
> +		};
> +
> +		upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 {
> +			compatible = "brcm,bcm7120-l2-intc";
> +			reg = <0x408b80 0x8>;
> +
> +			brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>;
> +			brcm,int-fwd-mask = <0>;
> +			brcm,irq-can-wake;
> +
> +			interrupt-controller;
> +			#interrupt-cells = <1>;
> +
> +			interrupt-parent = <&periph_intc>;
> +			interrupts = <57>, <55>, <59>;
> +			interrupt-names = "upg_main_aon", "upg_bsc_aon",
> +					  "upg_spi";
>  		};
>  
>  		sun_top_ctrl: syscon@404000 {
> @@ -138,6 +156,46 @@
>  			status = "disabled";
>  		};
>  
> +		bsca: i2c@406200 {
> +		      clock-frequency = <390000>;
> +		      compatible = "brcm,brcmstb-i2c";
> +		      interrupt-parent = <&upg_irq0_intc>;
> +		      reg = <0x406200 0x58>;
> +		      interrupts = <24>;
> +		      interrupt-names = "upg_bsca";
> +		      status = "disabled";
> +		};
> +
> +		bscb: i2c@406280 {
> +		      clock-frequency = <390000>;
> +		      compatible = "brcm,brcmstb-i2c";
> +		      interrupt-parent = <&upg_irq0_intc>;
> +		      reg = <0x406280 0x58>;
> +		      interrupts = <25>;
> +		      interrupt-names = "upg_bscb";
> +		      status = "disabled";
> +		};
> +
> +		bscc: i2c@406300 {
> +		      clock-frequency = <390000>;
> +		      compatible = "brcm,brcmstb-i2c";
> +		      interrupt-parent = <&upg_irq0_intc>;
> +		      reg = <0x406300 0x58>;
> +		      interrupts = <26>;
> +		      interrupt-names = "upg_bscc";
> +		      status = "disabled";
> +		};
> +
> +		bscd: i2c@408980 {
> +		      clock-frequency = <390000>;
> +		      compatible = "brcm,brcmstb-i2c";
> +		      interrupt-parent = <&upg_aon_irq0_intc>;
> +		      reg = <0x408980 0x58>;
> +		      interrupts = <27>;
> +		      interrupt-names = "upg_bscd";
> +		      status = "disabled";
> +		};
> +
>  		enet0: ethernet@430000 {
>  			phy-mode = "internal";
>  			phy-handle = <&phy1>;
> diff --git a/arch/mips/boot/dts/brcm/bcm97360svmb.dts b/arch/mips/boot/dts/brcm/bcm97360svmb.dts
> index eee8b0e32681..d48462e091f1 100644
> --- a/arch/mips/boot/dts/brcm/bcm97360svmb.dts
> +++ b/arch/mips/boot/dts/brcm/bcm97360svmb.dts
> @@ -29,6 +29,22 @@
>  	status = "okay";
>  };
>  
> +&bsca {
> +	status = "okay";
> +};
> +
> +&bscb {
> +	status = "okay";
> +};
> +
> +&bscc {
> +	status = "okay";
> +};
> +
> +&bscd {
> +	status = "okay";
> +};
> +
>  &enet0 {
>  	status = "okay";
>  };
> 


-- 
Florian

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

* Re: [PATCH 9/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7362
  2015-10-21  2:37 ` [PATCH 9/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7362 Jaedon Shin
@ 2015-10-22  1:57   ` Florian Fainelli
  0 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2015-10-22  1:57 UTC (permalink / raw)
  To: Jaedon Shin, Wolfram Sang, Kamal Dasu, Ralf Baechle
  Cc: linux-i2c, devicetree, linux-mips

Le 20/10/2015 19:37, Jaedon Shin a écrit :
> Add I2C device nodes to BMIPS based BCM7362 platform.
> 
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  arch/mips/boot/dts/brcm/bcm7362.dtsi     | 52 ++++++++++++++++++++++++++++++--
>  arch/mips/boot/dts/brcm/bcm97362svmb.dts | 12 ++++++++
>  2 files changed, 62 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/boot/dts/brcm/bcm7362.dtsi b/arch/mips/boot/dts/brcm/bcm7362.dtsi
> index 6e65db86fc61..5f817be2553c 100644
> --- a/arch/mips/boot/dts/brcm/bcm7362.dtsi
> +++ b/arch/mips/boot/dts/brcm/bcm7362.dtsi
> @@ -87,14 +87,32 @@
>  			compatible = "brcm,bcm7120-l2-intc";
>  			reg = <0x406600 0x8>;
>  
> -			brcm,int-map-mask = <0x44>;
> +			brcm,int-map-mask = <0x44>, <0x7000000>;
>  			brcm,int-fwd-mask = <0x70000>;
>  
>  			interrupt-controller;
>  			#interrupt-cells = <1>;
>  
>  			interrupt-parent = <&periph_intc>;
> -			interrupts = <56>;
> +			interrupts = <56>, <54>;
> +			interrupt-names = "upg_main", "upg_bsc";
> +		};
> +
> +		upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 {
> +			compatible = "brcm,bcm7120-l2-intc";
> +			reg = <0x408b80 0x8>;
> +
> +			brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>;
> +			brcm,int-fwd-mask = <0>;
> +			brcm,irq-can-wake;
> +
> +			interrupt-controller;
> +			#interrupt-cells = <1>;
> +
> +			interrupt-parent = <&periph_intc>;
> +			interrupts = <57>, <55>, <59>;
> +			interrupt-names = "upg_main_aon", "upg_bsc_aon",
> +					  "upg_spi";
>  		};
>  
>  		sun_top_ctrl: syscon@404000 {
> @@ -144,6 +162,36 @@
>  			status = "disabled";
>  		};
>  
> +		bsca: i2c@406200 {
> +		      clock-frequency = <390000>;
> +		      compatible = "brcm,brcmstb-i2c";
> +		      interrupt-parent = <&upg_irq0_intc>;
> +		      reg = <0x406200 0x58>;
> +		      interrupts = <24>;
> +		      interrupt-names = "upg_bsca";
> +		      status = "disabled";
> +		};
> +
> +		bscb: i2c@406280 {
> +		      clock-frequency = <390000>;
> +		      compatible = "brcm,brcmstb-i2c";
> +		      interrupt-parent = <&upg_irq0_intc>;
> +		      reg = <0x406280 0x58>;
> +		      interrupts = <25>;
> +		      interrupt-names = "upg_bscb";
> +		      status = "disabled";
> +		};
> +
> +		bscd: i2c@408980 {
> +		      clock-frequency = <390000>;
> +		      compatible = "brcm,brcmstb-i2c";
> +		      interrupt-parent = <&upg_aon_irq0_intc>;
> +		      reg = <0x408980 0x58>;
> +		      interrupts = <27>;
> +		      interrupt-names = "upg_bscd";
> +		      status = "disabled";
> +		};
> +
>  		enet0: ethernet@430000 {
>  			phy-mode = "internal";
>  			phy-handle = <&phy1>;
> diff --git a/arch/mips/boot/dts/brcm/bcm97362svmb.dts b/arch/mips/boot/dts/brcm/bcm97362svmb.dts
> index 739c2ef5663b..9c99bfd1e781 100644
> --- a/arch/mips/boot/dts/brcm/bcm97362svmb.dts
> +++ b/arch/mips/boot/dts/brcm/bcm97362svmb.dts
> @@ -29,6 +29,18 @@
>  	status = "okay";
>  };
>  
> +&bsca {
> +	status = "okay";
> +};
> +
> +&bscb {
> +	status = "okay";
> +};
> +
> +&bscd {
> +	status = "okay";
> +};
> +
>  &enet0 {
>  	status = "okay";
>  };
> 


-- 
Florian

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

* Re: [PATCH 3/9] i2c: brcmstb: add missing parenthesis
  2015-10-22  1:56   ` Florian Fainelli
@ 2015-11-30 15:36     ` Wolfram Sang
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2015-11-30 15:36 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Jaedon Shin, Kamal Dasu, Ralf Baechle, linux-i2c, devicetree, linux-mips

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

On Wed, Oct 21, 2015 at 06:56:44PM -0700, Florian Fainelli wrote:
> Le 20/10/2015 19:36, Jaedon Shin a écrit :
> > Add the necessary parenthesis for NOACK condition.
> > 
> > Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
> 
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>

I wouldn't call them necessary?

> 
> > ---
> >  drivers/i2c/busses/i2c-brcmstb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
> > index 6b8bbf99880d..2d7d155029dc 100644
> > --- a/drivers/i2c/busses/i2c-brcmstb.c
> > +++ b/drivers/i2c/busses/i2c-brcmstb.c
> > @@ -305,7 +305,7 @@ static int brcmstb_send_i2c_cmd(struct brcmstb_i2c_dev *dev,
> >  	}
> >  
> >  	if ((CMD_RD || CMD_WR) &&
> > -	    bsc_readl(dev, iic_enable) & BSC_IIC_EN_NOACK_MASK) {
> > +	    (bsc_readl(dev, iic_enable) & BSC_IIC_EN_NOACK_MASK)) {
> >  		rc = -EREMOTEIO;
> >  		dev_dbg(dev->device, "controller received NOACK intr for %s\n",
> >  			cmd_string[cmd]);
> > 
> 
> 
> -- 
> Florian

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

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

* Re: [PATCH 4/9] i2c: brcmstb: enable ACK condition
  2015-10-21  2:36 ` [PATCH 4/9] i2c: brcmstb: enable ACK condition Jaedon Shin
@ 2015-11-30 15:37   ` Wolfram Sang
  2016-07-14  4:15     ` Jaedon Shin
  0 siblings, 1 reply; 28+ messages in thread
From: Wolfram Sang @ 2015-11-30 15:37 UTC (permalink / raw)
  To: Jaedon Shin
  Cc: Kamal Dasu, Ralf Baechle, Florian Fainelli, linux-i2c,
	devicetree, linux-mips

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

On Wed, Oct 21, 2015 at 11:36:56AM +0900, Jaedon Shin wrote:
> Removes the condition of a message with under 32 bytes in length. The
> messages that do not require an ACK are I2C_M_IGNORE_NAK flag.

Makes me wonder why it worked before? Kamal?

> 
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
> ---
>  drivers/i2c/busses/i2c-brcmstb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
> index 2d7d155029dc..53eb8b0c9bad 100644
> --- a/drivers/i2c/busses/i2c-brcmstb.c
> +++ b/drivers/i2c/busses/i2c-brcmstb.c
> @@ -330,7 +330,7 @@ static int brcmstb_i2c_xfer_bsc_data(struct brcmstb_i2c_dev *dev,
>  	int no_ack = pmsg->flags & I2C_M_IGNORE_NAK;
>  
>  	/* see if the transaction needs to check NACK conditions */
> -	if (no_ack || len <= N_DATA_BYTES) {
> +	if (no_ack) {
>  		cmd = (pmsg->flags & I2C_M_RD) ? CMD_RD_NOACK
>  			: CMD_WR_NOACK;
>  		pi2creg->ctlhi_reg |= BSC_CTLHI_REG_IGNORE_ACK_MASK;
> -- 
> 2.6.1
> 

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

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

* Re: [PATCH 5/9] i2c: brcmstb: fix start and stop conditions
  2015-10-21  2:36     ` Jaedon Shin
  (?)
@ 2015-11-30 15:41     ` Wolfram Sang
  -1 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2015-11-30 15:41 UTC (permalink / raw)
  To: Jaedon Shin
  Cc: Kamal Dasu, Ralf Baechle, Florian Fainelli, linux-i2c,
	devicetree, linux-mips

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

On Wed, Oct 21, 2015 at 11:36:57AM +0900, Jaedon Shin wrote:
> Fixes conditions for RESTART, NOSTART and NOSTOP. The masks of start and
> stop is already in brcmstb_set_i2c_start_stop(). Therefore, the caller
> does not need a mask value.

Hmm, and what if that changes for some reason in the future (driver
refactoring)? I'd rather leave it as it is; it is a micro-optimization
after all.

> 
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
> ---
>  drivers/i2c/busses/i2c-brcmstb.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
> index 53eb8b0c9bad..dcd1209f843f 100644
> --- a/drivers/i2c/busses/i2c-brcmstb.c
> +++ b/drivers/i2c/busses/i2c-brcmstb.c
> @@ -464,7 +464,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter,
>  			pmsg->buf ? pmsg->buf[0] : '0', pmsg->len);
>  
>  		if (i < (num - 1) && (msgs[i + 1].flags & I2C_M_NOSTART))
> -			brcmstb_set_i2c_start_stop(dev, ~(COND_START_STOP));
> +			brcmstb_set_i2c_start_stop(dev, 0);
>  		else
>  			brcmstb_set_i2c_start_stop(dev,
>  						   COND_RESTART | COND_NOSTOP);
> @@ -485,8 +485,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter,
>  			bytes_to_xfer = min(len, N_DATA_BYTES);
>  
>  			if (len <= N_DATA_BYTES && i == (num - 1))
> -				brcmstb_set_i2c_start_stop(dev,
> -							   ~(COND_START_STOP));
> +				brcmstb_set_i2c_start_stop(dev, 0);
>  
>  			rc = brcmstb_i2c_xfer_bsc_data(dev, tmp_buf,
>  						       bytes_to_xfer, pmsg);
> -- 
> 2.6.1
> 

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

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

* Re: [PATCH 4/9] i2c: brcmstb: enable ACK condition
  2015-11-30 15:37   ` Wolfram Sang
@ 2016-07-14  4:15     ` Jaedon Shin
  2016-07-14 17:14       ` Kamal Dasu
  0 siblings, 1 reply; 28+ messages in thread
From: Jaedon Shin @ 2016-07-14  4:15 UTC (permalink / raw)
  To: Kamal Dasu; +Cc: Wolfram Sang, Florian Fainelli, linux-i2c

Hi Kamal,

On Dec 1, 2015, at 12:37 AM, Wolfram Sang <wsa@the-dreams.de> wrote:
> 
> On Wed, Oct 21, 2015 at 11:36:56AM +0900, Jaedon Shin wrote:
>> Removes the condition of a message with under 32 bytes in length. The
>> messages that do not require an ACK are I2C_M_IGNORE_NAK flag.
> 
> Makes me wonder why it worked before? Kamal?
> 
>> 
>> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
>> ---
>> drivers/i2c/busses/i2c-brcmstb.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
>> index 2d7d155029dc..53eb8b0c9bad 100644
>> --- a/drivers/i2c/busses/i2c-brcmstb.c
>> +++ b/drivers/i2c/busses/i2c-brcmstb.c
>> @@ -330,7 +330,7 @@ static int brcmstb_i2c_xfer_bsc_data(struct brcmstb_i2c_dev *dev,
>> 	int no_ack = pmsg->flags & I2C_M_IGNORE_NAK;
>> 
>> 	/* see if the transaction needs to check NACK conditions */
>> -	if (no_ack || len <= N_DATA_BYTES) {

Could you please explain why have NOACK with smaller transfer size? I don't find any 
reason about NOACK when smaller size, and the driver always operates NOACK by "len <= xfersz".

brcmstb_i2c_xfer(...)
{
	int xfersz = brcmstb_i2c_get_xfersz(dev);
	...
	bytes_to_xfer = min(len, xfersz);
	...
	brcmstb_i2c_xfer_bsc_data(..., bytes_to_xfer, ...);
	...

I have a plan for v2 that has for BMIPS_GENERIC and this patch with the latest driver.

Thanks!
--
Jaedon

>> +	if (no_ack) {
>> 		cmd = (pmsg->flags & I2C_M_RD) ? CMD_RD_NOACK
>> 			: CMD_WR_NOACK;
>> 		pi2creg->ctlhi_reg |= BSC_CTLHI_REG_IGNORE_ACK_MASK;
>> -- 
>> 2.6.1
>> 

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

* Re: [PATCH 4/9] i2c: brcmstb: enable ACK condition
  2016-07-14  4:15     ` Jaedon Shin
@ 2016-07-14 17:14       ` Kamal Dasu
  2016-07-15  5:57         ` Wolfram Sang
  0 siblings, 1 reply; 28+ messages in thread
From: Kamal Dasu @ 2016-07-14 17:14 UTC (permalink / raw)
  To: Jaedon Shin; +Cc: Wolfram Sang, Florian Fainelli, linux-i2c

Jaedon,

Your change looks good to me.  I agree that we do not need the size check.

Kamal

On Thu, Jul 14, 2016 at 12:15 AM, Jaedon Shin <jaedon.shin@gmail.com> wrote:
> Hi Kamal,
>
> On Dec 1, 2015, at 12:37 AM, Wolfram Sang <wsa@the-dreams.de> wrote:
>>
>> On Wed, Oct 21, 2015 at 11:36:56AM +0900, Jaedon Shin wrote:
>>> Removes the condition of a message with under 32 bytes in length. The
>>> messages that do not require an ACK are I2C_M_IGNORE_NAK flag.
>>
>> Makes me wonder why it worked before? Kamal?
>>
>>>
>>> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
>>> ---
>>> drivers/i2c/busses/i2c-brcmstb.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
>>> index 2d7d155029dc..53eb8b0c9bad 100644
>>> --- a/drivers/i2c/busses/i2c-brcmstb.c
>>> +++ b/drivers/i2c/busses/i2c-brcmstb.c
>>> @@ -330,7 +330,7 @@ static int brcmstb_i2c_xfer_bsc_data(struct brcmstb_i2c_dev *dev,
>>>      int no_ack = pmsg->flags & I2C_M_IGNORE_NAK;
>>>
>>>      /* see if the transaction needs to check NACK conditions */
>>> -    if (no_ack || len <= N_DATA_BYTES) {
>
> Could you please explain why have NOACK with smaller transfer size? I don't find any
> reason about NOACK when smaller size, and the driver always operates NOACK by "len <= xfersz".
>
> brcmstb_i2c_xfer(...)
> {
>         int xfersz = brcmstb_i2c_get_xfersz(dev);
>         ...
>         bytes_to_xfer = min(len, xfersz);
>         ...
>         brcmstb_i2c_xfer_bsc_data(..., bytes_to_xfer, ...);
>         ...
>
> I have a plan for v2 that has for BMIPS_GENERIC and this patch with the latest driver.
>
> Thanks!
> --
> Jaedon
>
>>> +    if (no_ack) {
>>>              cmd = (pmsg->flags & I2C_M_RD) ? CMD_RD_NOACK
>>>                      : CMD_WR_NOACK;
>>>              pi2creg->ctlhi_reg |= BSC_CTLHI_REG_IGNORE_ACK_MASK;
>>> --
>>> 2.6.1
>>>
>

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

* Re: [PATCH 4/9] i2c: brcmstb: enable ACK condition
  2016-07-14 17:14       ` Kamal Dasu
@ 2016-07-15  5:57         ` Wolfram Sang
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfram Sang @ 2016-07-15  5:57 UTC (permalink / raw)
  To: Kamal Dasu; +Cc: Jaedon Shin, Florian Fainelli, linux-i2c

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


> Your change looks good to me.  I agree that we do not need the size check.

I read this as an ack, thanks. But how did it work before?


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

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

end of thread, other threads:[~2016-07-15  5:58 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-21  2:36 [PATCH 0/9] i2c: brcmstb: add support for BMIPS_GENERIC Jaedon Shin
2015-10-21  2:36 ` Jaedon Shin
2015-10-21  2:36 ` [PATCH 1/9] i2c: brcmstb: make the driver buildable on BMIPS_GENERIC Jaedon Shin
2015-10-22  1:56   ` Florian Fainelli
2015-10-21  2:36 ` [PATCH 3/9] i2c: brcmstb: add missing parenthesis Jaedon Shin
2015-10-22  1:56   ` Florian Fainelli
2015-11-30 15:36     ` Wolfram Sang
2015-10-21  2:36 ` [PATCH 4/9] i2c: brcmstb: enable ACK condition Jaedon Shin
2015-11-30 15:37   ` Wolfram Sang
2016-07-14  4:15     ` Jaedon Shin
2016-07-14 17:14       ` Kamal Dasu
2016-07-15  5:57         ` Wolfram Sang
     [not found] ` <1445395021-4204-1-git-send-email-jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-21  2:36   ` [PATCH 2/9] i2c: brcmstb: fix typo in i2c-brcmstb Jaedon Shin
2015-10-21  2:36     ` Jaedon Shin
2015-10-22  1:56     ` Florian Fainelli
2015-10-21  2:36   ` [PATCH 5/9] i2c: brcmstb: fix start and stop conditions Jaedon Shin
2015-10-21  2:36     ` Jaedon Shin
2015-11-30 15:41     ` Wolfram Sang
2015-10-21  2:36   ` [PATCH 6/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7346 Jaedon Shin
2015-10-21  2:36     ` Jaedon Shin
     [not found]     ` <1445395021-4204-7-git-send-email-jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-22  1:57       ` Florian Fainelli
2015-10-22  1:57         ` Florian Fainelli
2015-10-21  2:36 ` [PATCH 7/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7358 Jaedon Shin
2015-10-22  1:57   ` Florian Fainelli
2015-10-21  2:37 ` [PATCH 8/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7360 Jaedon Shin
2015-10-22  1:57   ` Florian Fainelli
2015-10-21  2:37 ` [PATCH 9/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7362 Jaedon Shin
2015-10-22  1:57   ` Florian Fainelli

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.