All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Add block read/write to en50221 CAM functions
@ 2017-05-07 20:51 Jasmin J.
  2017-05-07 20:51 ` [PATCH 1/7] [media] dvb-core/dvb_ca_en50221.c: State UNINITIALISED instead of INVALID Jasmin J.
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: Jasmin J. @ 2017-05-07 20:51 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, max.kellermann, rjkm, d.scheller, jasmin

From: Jasmin Jessich <jasmin@anw.at>

These patch series implement a block read/write interface to the en50221
CAM control functions. The origin of this patches can be found in the
Digital Devices Git on https://github.com/DigitalDevices/dddvb maintained
by Ralph Metzler <rjkm@metzlerbros.de>

The relevant changes concerning dvb-core/dvb_ca_en50221.c/.h and
cxd2099/cxd2099.c/.h have been extracted from the mentioned repository by
Daniel Scheller <d.scheller@gmx.net> and committed to his branch on
https://github.com/herrnst/dddvb-linux-kernel/tree/mediatree/master-cxd2099

I split the patch set is smaller pieces for easier review, compiled each
step, fixed code style issues in cxd2099/cxd2099.c/.h (checkpatch.pl) and
tested the resulting driver on my hardware with the DD DuoFlex CI (single)
card.

Please note, that the block read/write functionality is already implemented
in the currently existing cxd2099/cxd2099.c/.h driver, but deactivated. The
existing code in this driver is also not functional and has been updated by
the working implementation from the Digital Devices Git.

Additionally to the block read/write functions, I merged also two patches
in the en50221 CAM control state machine, which were existing in the
Digital Devices Git. This are the first two patches of this series.

There is another patch series coming soon "Fix coding style in en50221 CAM
functions" which fixes nearly all the style issues in
dvb-core/dvb_ca_en50221.c/.h, based on this patch series. So please be
patient, if any of the dvb_ca_en50221.c/.h might be not 100% checkpatch.pl
compliant. I tried to keep the original patch code from DD as much as
possible.

Apologizes if anything regarding the patch submission is/went wrong, as
this is my first time contribution of a patch set.


Jasmin Jessich (7):
  [media] dvb-core/dvb_ca_en50221.c: State UNINITIALISED instead of INVALID
  [media] dvb-core/dvb_ca_en50221.c: Increase timeout for link init
  [media] dvb-core/dvb_ca_en50221.c: Add block read/write functions
  [staging] cxd2099/cxd2099.c/.h: Fixed buffer mode
  [media] ddbridge/ddbridge-core.c: Set maximum cxd2099 block size to 512
  [staging] cxd2099/cxd2099.c: Removed useless printing in cxd2099 driver
  [staging] cxd2099/cxd2099.c: Activate cxd2099 buffer mode

 drivers/media/dvb-core/dvb_ca_en50221.c    | 121 ++++++++-------
 drivers/media/dvb-core/dvb_ca_en50221.h    |   7 +
 drivers/media/pci/ddbridge/ddbridge-core.c |   1 +
 drivers/staging/media/cxd2099/cxd2099.c    | 237 ++++++++++++++---------------
 drivers/staging/media/cxd2099/cxd2099.h    |   6 +-
 5 files changed, 196 insertions(+), 176 deletions(-)

-- 
2.7.4

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

* [PATCH 1/7] [media] dvb-core/dvb_ca_en50221.c: State UNINITIALISED instead of INVALID
  2017-05-07 20:51 [PATCH 0/7] Add block read/write to en50221 CAM functions Jasmin J.
@ 2017-05-07 20:51 ` Jasmin J.
  2017-05-07 20:51 ` [PATCH 2/7] [media] dvb-core/dvb_ca_en50221.c: Increase timeout for link init Jasmin J.
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: Jasmin J. @ 2017-05-07 20:51 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, max.kellermann, rjkm, d.scheller, jasmin

From: Jasmin Jessich <jasmin@anw.at>

In case of a linkinit failure change to state UNINITIALISED to re-init
the CAM.

Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
---
 drivers/media/dvb-core/dvb_ca_en50221.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
index d38bf9b..9b90d3e 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb-core/dvb_ca_en50221.c
@@ -1172,7 +1172,7 @@ static int dvb_ca_en50221_thread(void *data)
 
 					pr_err("dvb_ca adapter %d: DVB CAM link initialisation failed :(\n",
 					       ca->dvbdev->adapter->num);
-					ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID;
+					ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_UNINITIALISED;
 					dvb_ca_en50221_thread_update_delay(ca);
 					break;
 				}
-- 
2.7.4

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

* [PATCH 2/7] [media] dvb-core/dvb_ca_en50221.c: Increase timeout for link init
  2017-05-07 20:51 [PATCH 0/7] Add block read/write to en50221 CAM functions Jasmin J.
  2017-05-07 20:51 ` [PATCH 1/7] [media] dvb-core/dvb_ca_en50221.c: State UNINITIALISED instead of INVALID Jasmin J.
@ 2017-05-07 20:51 ` Jasmin J.
  2017-05-07 20:51 ` [PATCH 3/7] [media] dvb-core/dvb_ca_en50221.c: Add block read/write functions Jasmin J.
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: Jasmin J. @ 2017-05-07 20:51 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, max.kellermann, rjkm, d.scheller, jasmin

From: Jasmin Jessich <jasmin@anw.at>

Some CAMs do a really slow initialization, which requires a longer timeout
for the first response.

Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
---
 drivers/media/dvb-core/dvb_ca_en50221.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
index 9b90d3e..1cdd80a 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb-core/dvb_ca_en50221.c
@@ -347,7 +347,7 @@ static int dvb_ca_en50221_link_init(struct dvb_ca_private *ca, int slot)
 	/* read the buffer size from the CAM */
 	if ((ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN | CMDREG_SR)) != 0)
 		return ret;
-	if ((ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_DA, HZ / 10)) != 0)
+	if ((ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_DA, HZ)) != 0)
 		return ret;
 	if ((ret = dvb_ca_en50221_read_data(ca, slot, buf, 2)) != 2)
 		return -EIO;
-- 
2.7.4

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

* [PATCH 3/7] [media] dvb-core/dvb_ca_en50221.c: Add block read/write functions
  2017-05-07 20:51 [PATCH 0/7] Add block read/write to en50221 CAM functions Jasmin J.
  2017-05-07 20:51 ` [PATCH 1/7] [media] dvb-core/dvb_ca_en50221.c: State UNINITIALISED instead of INVALID Jasmin J.
  2017-05-07 20:51 ` [PATCH 2/7] [media] dvb-core/dvb_ca_en50221.c: Increase timeout for link init Jasmin J.
@ 2017-05-07 20:51 ` Jasmin J.
  2017-06-24 19:16   ` Mauro Carvalho Chehab
  2017-05-07 20:51 ` [PATCH 4/7] [staging] cxd2099/cxd2099.c/.h: Fixed buffer mode Jasmin J.
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 19+ messages in thread
From: Jasmin J. @ 2017-05-07 20:51 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, max.kellermann, rjkm, d.scheller, jasmin

From: Jasmin Jessich <jasmin@anw.at>

Some lower level drivers may work better when sending blocks of data instead
byte per byte. For this we need new function pointers in the dvb_ca_en50221
protocol structure (read_data, write_data) and the protocol needs to execute
them, if they are defined.
Block data transmission is done in all states expect LINKINIT.

Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
---
 drivers/media/dvb-core/dvb_ca_en50221.c | 117 ++++++++++++++++++--------------
 drivers/media/dvb-core/dvb_ca_en50221.h |   7 ++
 2 files changed, 73 insertions(+), 51 deletions(-)

diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
index 1cdd80a..cc709c9 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb-core/dvb_ca_en50221.c
@@ -646,66 +646,78 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb
 		}
 	}
 
-	/* check if there is data available */
-	if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
-		goto exit;
-	if (!(status & STATUSREG_DA)) {
-		/* no data */
-		status = 0;
-		goto exit;
-	}
-
-	/* read the amount of data */
-	if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_SIZE_HIGH)) < 0)
-		goto exit;
-	bytes_read = status << 8;
-	if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_SIZE_LOW)) < 0)
-		goto exit;
-	bytes_read |= status;
+	if (ca->pub->read_data && (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_LINKINIT)) {
+		if (ebuf == NULL)
+			status = ca->pub->read_data(ca->pub, slot, buf, sizeof(buf));
+		else
+			status = ca->pub->read_data(ca->pub, slot, buf, ecount);
+		if (status < 0)
+			return status;
+		bytes_read =  status;
+		if (status == 0)
+			goto exit;
+	} else {
 
-	/* check it will fit */
-	if (ebuf == NULL) {
-		if (bytes_read > ca->slot_info[slot].link_buf_size) {
-			pr_err("dvb_ca adapter %d: CAM tried to send a buffer larger than the link buffer size (%i > %i)!\n",
-			       ca->dvbdev->adapter->num, bytes_read,
-			       ca->slot_info[slot].link_buf_size);
-			ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
-			status = -EIO;
+		/* check if there is data available */
+		if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
 			goto exit;
-		}
-		if (bytes_read < 2) {
-			pr_err("dvb_ca adapter %d: CAM sent a buffer that was less than 2 bytes!\n",
-			       ca->dvbdev->adapter->num);
-			ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
-			status = -EIO;
+		if (!(status & STATUSREG_DA)) {
+			/* no data */
+			status = 0;
 			goto exit;
 		}
-	} else {
-		if (bytes_read > ecount) {
-			pr_err("dvb_ca adapter %d: CAM tried to send a buffer larger than the ecount size!\n",
-			       ca->dvbdev->adapter->num);
-			status = -EIO;
+
+		/* read the amount of data */
+		if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_SIZE_HIGH)) < 0)
+			goto exit;
+		bytes_read = status << 8;
+		if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_SIZE_LOW)) < 0)
 			goto exit;
+		bytes_read |= status;
+
+		/* check it will fit */
+		if (ebuf == NULL) {
+			if (bytes_read > ca->slot_info[slot].link_buf_size) {
+				pr_err("dvb_ca adapter %d: CAM tried to send a buffer larger than the link buffer size (%i > %i)!\n",
+				       ca->dvbdev->adapter->num, bytes_read, ca->slot_info[slot].link_buf_size);
+				ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
+				status = -EIO;
+				goto exit;
+			}
+			if (bytes_read < 2) {
+				pr_err("dvb_ca adapter %d: CAM sent a buffer that was less than 2 bytes!\n",
+				       ca->dvbdev->adapter->num);
+				ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
+				status = -EIO;
+				goto exit;
+			}
+		} else {
+			if (bytes_read > ecount) {
+				pr_err("dvb_ca adapter %d: CAM tried to send a buffer larger than the ecount size!\n",
+				       ca->dvbdev->adapter->num);
+				status = -EIO;
+				goto exit;
+			}
 		}
-	}
 
-	/* fill the buffer */
-	for (i = 0; i < bytes_read; i++) {
-		/* read byte and check */
-		if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_DATA)) < 0)
-			goto exit;
+		/* fill the buffer */
+		for (i = 0; i < bytes_read; i++) {
+			/* read byte and check */
+			if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_DATA)) < 0)
+				goto exit;
 
-		/* OK, store it in the buffer */
-		buf[i] = status;
-	}
+			/* OK, store it in the buffer */
+			buf[i] = status;
+		}
 
-	/* check for read error (RE should now be 0) */
-	if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
-		goto exit;
-	if (status & STATUSREG_RE) {
-		ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
-		status = -EIO;
-		goto exit;
+		/* check for read error (RE should now be 0) */
+		if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
+			goto exit;
+		if (status & STATUSREG_RE) {
+			ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
+			status = -EIO;
+			goto exit;
+		}
 	}
 
 	/* OK, add it to the receive buffer, or copy into external buffer if supplied */
@@ -757,6 +769,9 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * b
 	if (bytes_write > ca->slot_info[slot].link_buf_size)
 		return -EINVAL;
 
+	if (ca->pub->write_data && (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_LINKINIT))
+		return ca->pub->write_data(ca->pub, slot, buf, bytes_write);
+
 	/* it is possible we are dealing with a single buffer implementation,
 	   thus if there is data available for read or if there is even a read
 	   already in progress, we do nothing but awake the kernel thread to
diff --git a/drivers/media/dvb-core/dvb_ca_en50221.h b/drivers/media/dvb-core/dvb_ca_en50221.h
index 1e4bbbd..82617ba 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.h
+++ b/drivers/media/dvb-core/dvb_ca_en50221.h
@@ -41,6 +41,8 @@
  * @write_attribute_mem: function for writing attribute memory on the CAM
  * @read_cam_control:	function for reading the control interface on the CAM
  * @write_cam_control:	function for reading the control interface on the CAM
+ * @read_data:		function for reading data (block mode)
+ * @write_data:		function for writing data (block mode)
  * @slot_reset:		function to reset the CAM slot
  * @slot_shutdown:	function to shutdown a CAM slot
  * @slot_ts_enable:	function to enable the Transport Stream on a CAM slot
@@ -66,6 +68,11 @@ struct dvb_ca_en50221 {
 	int (*write_cam_control)(struct dvb_ca_en50221 *ca,
 				 int slot, u8 address, u8 value);
 
+	int (*read_data)(struct dvb_ca_en50221 *ca,
+				int slot, u8 *ebuf, int ecount);
+	int (*write_data)(struct dvb_ca_en50221 *ca,
+				int slot, u8 *ebuf, int ecount);
+
 	int (*slot_reset)(struct dvb_ca_en50221 *ca, int slot);
 	int (*slot_shutdown)(struct dvb_ca_en50221 *ca, int slot);
 	int (*slot_ts_enable)(struct dvb_ca_en50221 *ca, int slot);
-- 
2.7.4

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

* [PATCH 4/7] [staging] cxd2099/cxd2099.c/.h: Fixed buffer mode
  2017-05-07 20:51 [PATCH 0/7] Add block read/write to en50221 CAM functions Jasmin J.
                   ` (2 preceding siblings ...)
  2017-05-07 20:51 ` [PATCH 3/7] [media] dvb-core/dvb_ca_en50221.c: Add block read/write functions Jasmin J.
@ 2017-05-07 20:51 ` Jasmin J.
  2017-05-07 20:51 ` [PATCH 5/7] [media] ddbridge/ddbridge-core.c: Set maximum cxd2099 block size to 512 Jasmin J.
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: Jasmin J. @ 2017-05-07 20:51 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, max.kellermann, rjkm, d.scheller, jasmin

From: Jasmin Jessich <jasmin@anw.at>

The buffer mode was already implemented in this driver, but it did not work
as expected. This has been fixed now, but it is still deactivated and can
be activated by removing a comment at the begin of the file.

Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
---
 drivers/staging/media/cxd2099/cxd2099.c | 232 ++++++++++++++++----------------
 drivers/staging/media/cxd2099/cxd2099.h |   6 +-
 2 files changed, 120 insertions(+), 118 deletions(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c
index c72c3f0..ac01433 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -1,7 +1,7 @@
 /*
  * cxd2099.c: Driver for the CXD2099AR Common Interface Controller
  *
- * Copyright (C) 2010-2011 Digital Devices GmbH
+ * Copyright (C) 2010-2013 Digital Devices GmbH
  *
  *
  * This program is free software; you can redistribute it and/or
@@ -33,7 +33,9 @@
 
 #include "cxd2099.h"
 
-#define MAX_BUFFER_SIZE 248
+/* #define BUFFER_MODE 1 */
+
+static int read_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount);
 
 struct cxd {
 	struct dvb_ca_en50221 en;
@@ -48,6 +50,7 @@ struct cxd {
 	int    mode;
 	int    ready;
 	int    dr;
+	int    write_busy;
 	int    slot_stat;
 
 	u8     amem[1024];
@@ -55,6 +58,9 @@ struct cxd {
 
 	int    cammode;
 	struct mutex lock;
+
+	u8     rbuf[1028];
+	u8     wbuf[1028];
 };
 
 static int i2c_write_reg(struct i2c_adapter *adapter, u8 adr,
@@ -73,7 +79,7 @@ static int i2c_write_reg(struct i2c_adapter *adapter, u8 adr,
 }
 
 static int i2c_write(struct i2c_adapter *adapter, u8 adr,
-		     u8 *data, u8 len)
+		     u8 *data, u16 len)
 {
 	struct i2c_msg msg = {.addr = adr, .flags = 0, .buf = data, .len = len};
 
@@ -100,7 +106,7 @@ static int i2c_read_reg(struct i2c_adapter *adapter, u8 adr,
 }
 
 static int i2c_read(struct i2c_adapter *adapter, u8 adr,
-		    u8 reg, u8 *data, u8 n)
+		    u8 reg, u8 *data, u16 n)
 {
 	struct i2c_msg msgs[2] = {{.addr = adr, .flags = 0,
 				 .buf = &reg, .len = 1},
@@ -114,14 +120,26 @@ static int i2c_read(struct i2c_adapter *adapter, u8 adr,
 	return 0;
 }
 
-static int read_block(struct cxd *ci, u8 adr, u8 *data, u8 n)
+static int read_block(struct cxd *ci, u8 adr, u8 *data, u16 n)
 {
-	int status;
+	int status = 0;
 
-	status = i2c_write_reg(ci->i2c, ci->cfg.adr, 0, adr);
+	if (ci->lastaddress != adr)
+		status = i2c_write_reg(ci->i2c, ci->cfg.adr, 0, adr);
 	if (!status) {
 		ci->lastaddress = adr;
-		status = i2c_read(ci->i2c, ci->cfg.adr, 1, data, n);
+
+		while (n) {
+			int len = n;
+
+			if (ci->cfg.max_i2c && (len > ci->cfg.max_i2c))
+				len = ci->cfg.max_i2c;
+			status = i2c_read(ci->i2c, ci->cfg.adr, 1, data, len);
+			if (status)
+				return status;
+			data += len;
+			n -= len;
+		}
 	}
 	return status;
 }
@@ -181,46 +199,18 @@ static int write_io(struct cxd *ci, u16 address, u8 val)
 	return status;
 }
 
-#if 0
-static int read_io_data(struct cxd *ci, u8 *data, u8 n)
-{
-	int status;
-	u8 addr[3] = { 2, 0, 0 };
-
-	status = i2c_write(ci->i2c, ci->cfg.adr, addr, 3);
-	if (!status)
-		status = i2c_read(ci->i2c, ci->cfg.adr, 3, data, n);
-	return 0;
-}
-
-static int write_io_data(struct cxd *ci, u8 *data, u8 n)
-{
-	int status;
-	u8 addr[3] = {2, 0, 0};
-
-	status = i2c_write(ci->i2c, ci->cfg.adr, addr, 3);
-	if (!status) {
-		u8 buf[256] = {3};
-
-		memcpy(buf+1, data, n);
-		status = i2c_write(ci->i2c, ci->cfg.adr, buf, n + 1);
-	}
-	return 0;
-}
-#endif
-
 static int write_regm(struct cxd *ci, u8 reg, u8 val, u8 mask)
 {
-	int status;
+	int status = 0;
 
-	status = i2c_write_reg(ci->i2c, ci->cfg.adr, 0, reg);
+	if (ci->lastaddress != reg)
+		status = i2c_write_reg(ci->i2c, ci->cfg.adr, 0, reg);
 	if (!status && reg >= 6 && reg <= 8 && mask != 0xff)
 		status = i2c_read_reg(ci->i2c, ci->cfg.adr, 1, &ci->regs[reg]);
+	ci->lastaddress = reg;
 	ci->regs[reg] = (ci->regs[reg] & (~mask)) | val;
-	if (!status) {
-		ci->lastaddress = reg;
+	if (!status)
 		status = i2c_write_reg(ci->i2c, ci->cfg.adr, 1, ci->regs[reg]);
-	}
 	if (reg == 0x20)
 		ci->regs[reg] &= 0x7f;
 	return status;
@@ -232,16 +222,31 @@ static int write_reg(struct cxd *ci, u8 reg, u8 val)
 }
 
 #ifdef BUFFER_MODE
-static int write_block(struct cxd *ci, u8 adr, u8 *data, int n)
+static int write_block(struct cxd *ci, u8 adr, u8 *data, u16 n)
 {
-	int status;
-	u8 buf[256] = {1};
-
-	status = i2c_write_reg(ci->i2c, ci->cfg.adr, 0, adr);
-	if (!status) {
-		ci->lastaddress = adr;
-		memcpy(buf + 1, data, n);
-		status = i2c_write(ci->i2c, ci->cfg.adr, buf, n + 1);
+	int status = 0;
+	u8 *buf = ci->wbuf;
+
+	if (ci->lastaddress != adr)
+		status = i2c_write_reg(ci->i2c, ci->cfg.adr, 0, adr);
+	if (status)
+		return status;
+	dev_info(&ci->i2c->dev, "write_block %d\n", n);
+
+	ci->lastaddress = adr;
+	buf[0] = 1;
+	while (n) {
+		int len = n;
+
+		if (ci->cfg.max_i2c && (len + 1 > ci->cfg.max_i2c))
+			len = ci->cfg.max_i2c - 1;
+		dev_info(&ci->i2c->dev, "write %d\n", len);
+		memcpy(buf + 1, data, len);
+		status = i2c_write(ci->i2c, ci->cfg.adr, buf, len + 1);
+		if (status)
+			return status;
+		n -= len;
+		data += len;
 	}
 	return status;
 }
@@ -267,6 +272,8 @@ static void set_mode(struct cxd *ci, int mode)
 
 static void cam_mode(struct cxd *ci, int mode)
 {
+	u8 dummy;
+
 	if (mode == ci->cammode)
 		return;
 
@@ -275,16 +282,15 @@ static void cam_mode(struct cxd *ci, int mode)
 		write_regm(ci, 0x20, 0x80, 0x80);
 		break;
 	case 0x01:
-#ifdef BUFFER_MODE
 		if (!ci->en.read_data)
 			return;
+		ci->write_busy = 0;
 		dev_info(&ci->i2c->dev, "enable cam buffer mode\n");
-		/* write_reg(ci, 0x0d, 0x00); */
-		/* write_reg(ci, 0x0e, 0x01); */
+		write_reg(ci, 0x0d, 0x00);
+		write_reg(ci, 0x0e, 0x01);
 		write_regm(ci, 0x08, 0x40, 0x40);
-		/* read_reg(ci, 0x12, &dummy); */
+		read_reg(ci, 0x12, &dummy);
 		write_regm(ci, 0x08, 0x80, 0x80);
-#endif
 		break;
 	default:
 		break;
@@ -292,8 +298,6 @@ static void cam_mode(struct cxd *ci, int mode)
 	ci->cammode = mode;
 }
 
-
-
 static int init(struct cxd *ci)
 {
 	int status;
@@ -329,12 +333,6 @@ static int init(struct cxd *ci)
 		if (status < 0)
 			break;
 
-#if 0
-		/* Input Mode C, BYPass Serial, TIVAL = low, MSB */
-		status = write_reg(ci, 0x09, 0x4D);
-		if (status < 0)
-			break;
-#endif
 		/* TOSTRT = 8, Mode B (gated clock), falling Edge,
 		 * Serial, POL=HIGH, MSB
 		 */
@@ -362,7 +360,10 @@ static int init(struct cxd *ci)
 		if (status < 0)
 			break;
 
-		if (ci->cfg.clock_mode) {
+		if (ci->cfg.clock_mode == 2) {
+			/* bitrate*2^13/ 72000 */
+			u32 reg = ((ci->cfg.bitrate << 13) + 71999) / 72000;
+
 			if (ci->cfg.polarity) {
 				status = write_reg(ci, 0x09, 0x6f);
 				if (status < 0)
@@ -372,6 +373,25 @@ static int init(struct cxd *ci)
 				if (status < 0)
 					break;
 			}
+			status = write_reg(ci, 0x20, 0x08);
+			if (status < 0)
+				break;
+			status = write_reg(ci, 0x21, (reg >> 8) & 0xff);
+			if (status < 0)
+				break;
+			status = write_reg(ci, 0x22, reg & 0xff);
+			if (status < 0)
+				break;
+		} else if (ci->cfg.clock_mode == 1) {
+			if (ci->cfg.polarity) {
+				status = write_reg(ci, 0x09, 0x6f); /* D */
+				if (status < 0)
+					break;
+			} else {
+				status = write_reg(ci, 0x09, 0x6d);
+				if (status < 0)
+					break;
+			}
 			status = write_reg(ci, 0x20, 0x68);
 			if (status < 0)
 				break;
@@ -383,7 +403,7 @@ static int init(struct cxd *ci)
 				break;
 		} else {
 			if (ci->cfg.polarity) {
-				status = write_reg(ci, 0x09, 0x4f);
+				status = write_reg(ci, 0x09, 0x4f); /* C */
 				if (status < 0)
 					break;
 			} else {
@@ -391,7 +411,6 @@ static int init(struct cxd *ci)
 				if (status < 0)
 					break;
 			}
-
 			status = write_reg(ci, 0x20, 0x28);
 			if (status < 0)
 				break;
@@ -432,32 +451,13 @@ static int read_attribute_mem(struct dvb_ca_en50221 *ca,
 			      int slot, int address)
 {
 	struct cxd *ci = ca->data;
-#if 0
-	if (ci->amem_read) {
-		if (address <= 0 || address > 1024)
-			return -EIO;
-		return ci->amem[address];
-	}
-
-	mutex_lock(&ci->lock);
-	write_regm(ci, 0x06, 0x00, 0x05);
-	read_pccard(ci, 0, &ci->amem[0], 128);
-	read_pccard(ci, 128, &ci->amem[0], 128);
-	read_pccard(ci, 256, &ci->amem[0], 128);
-	read_pccard(ci, 384, &ci->amem[0], 128);
-	write_regm(ci, 0x06, 0x05, 0x05);
-	mutex_unlock(&ci->lock);
-	return ci->amem[address];
-#else
 	u8 val;
 
 	mutex_lock(&ci->lock);
 	set_mode(ci, 1);
 	read_pccard(ci, address, &val, 1);
 	mutex_unlock(&ci->lock);
-	/* printk(KERN_INFO "%02x:%02x\n", address,val); */
 	return val;
-#endif
 }
 
 static int write_attribute_mem(struct dvb_ca_en50221 *ca, int slot,
@@ -501,16 +501,10 @@ static int slot_reset(struct dvb_ca_en50221 *ca, int slot)
 {
 	struct cxd *ci = ca->data;
 
+	if (ci->cammode)
+		read_data(ca, slot, ci->rbuf, 0);
+
 	mutex_lock(&ci->lock);
-#if 0
-	write_reg(ci, 0x00, 0x21);
-	write_reg(ci, 0x06, 0x1F);
-	write_reg(ci, 0x00, 0x31);
-#else
-#if 0
-	write_reg(ci, 0x06, 0x1F);
-	write_reg(ci, 0x06, 0x2F);
-#else
 	cam_mode(ci, 0);
 	write_reg(ci, 0x00, 0x21);
 	write_reg(ci, 0x06, 0x1F);
@@ -518,29 +512,17 @@ static int slot_reset(struct dvb_ca_en50221 *ca, int slot)
 	write_regm(ci, 0x20, 0x80, 0x80);
 	write_reg(ci, 0x03, 0x02);
 	ci->ready = 0;
-#endif
-#endif
 	ci->mode = -1;
 	{
 		int i;
-#if 0
-		u8 val;
-#endif
+
 		for (i = 0; i < 100; i++) {
 			usleep_range(10000, 11000);
-#if 0
-			read_reg(ci, 0x06, &val);
-			dev_info(&ci->i2c->dev, "%d:%02x\n", i, val);
-			if (!(val&0x10))
-				break;
-#else
 			if (ci->ready)
 				break;
-#endif
 		}
 	}
 	mutex_unlock(&ci->lock);
-	/* msleep(500); */
 	return 0;
 }
 
@@ -549,11 +531,19 @@ static int slot_shutdown(struct dvb_ca_en50221 *ca, int slot)
 	struct cxd *ci = ca->data;
 
 	dev_info(&ci->i2c->dev, "slot_shutdown\n");
+	if (ci->cammode)
+		read_data(ca, slot, ci->rbuf, 0);
 	mutex_lock(&ci->lock);
+	write_reg(ci, 0x00, 0x21);
+	write_reg(ci, 0x06, 0x1F);
+	msleep(300);
+
 	write_regm(ci, 0x09, 0x08, 0x08);
 	write_regm(ci, 0x20, 0x80, 0x80); /* Reset CAM Mode */
 	write_regm(ci, 0x06, 0x07, 0x07); /* Clear IO Mode */
+
 	ci->mode = -1;
+	ci->write_busy = 0;
 	mutex_unlock(&ci->lock);
 	return 0;
 }
@@ -565,9 +555,7 @@ static int slot_ts_enable(struct dvb_ca_en50221 *ca, int slot)
 	mutex_lock(&ci->lock);
 	write_regm(ci, 0x09, 0x00, 0x08);
 	set_mode(ci, 0);
-#ifdef BUFFER_MODE
 	cam_mode(ci, 1);
-#endif
 	mutex_unlock(&ci->lock);
 	return 0;
 }
@@ -586,8 +574,10 @@ static int campoll(struct cxd *ci)
 		ci->dr = 1;
 		dev_info(&ci->i2c->dev, "DR\n");
 	}
-	if (istat&0x20)
+	if (istat&0x20) {
+		ci->write_busy = 0;
 		dev_info(&ci->i2c->dev, "WC\n");
+	}
 
 	if (istat&2) {
 		u8 slotstat;
@@ -595,7 +585,8 @@ static int campoll(struct cxd *ci)
 		read_reg(ci, 0x01, &slotstat);
 		if (!(2&slotstat)) {
 			if (!ci->slot_stat) {
-				ci->slot_stat = DVB_CA_EN50221_POLL_CAM_PRESENT;
+				ci->slot_stat |=
+					      DVB_CA_EN50221_POLL_CAM_PRESENT;
 				write_regm(ci, 0x03, 0x08, 0x08);
 			}
 
@@ -607,8 +598,8 @@ static int campoll(struct cxd *ci)
 				ci->ready = 0;
 			}
 		}
-		if (istat&8 &&
-		    ci->slot_stat == DVB_CA_EN50221_POLL_CAM_PRESENT) {
+		if ((istat&8) &&
+		    (ci->slot_stat == DVB_CA_EN50221_POLL_CAM_PRESENT)) {
 			ci->ready = 1;
 			ci->slot_stat |= DVB_CA_EN50221_POLL_CAM_READY;
 		}
@@ -630,7 +621,6 @@ static int poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open)
 	return ci->slot_stat;
 }
 
-#ifdef BUFFER_MODE
 static int read_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount)
 {
 	struct cxd *ci = ca->data;
@@ -648,23 +638,33 @@ static int read_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount)
 	mutex_lock(&ci->lock);
 	read_reg(ci, 0x0f, &msb);
 	read_reg(ci, 0x10, &lsb);
-	len = (msb<<8)|lsb;
+	len = ((u16) msb << 8) | lsb;
+	if (len > ecount || len < 2) {
+		/* read it anyway or cxd may hang */
+		read_block(ci, 0x12, ci->rbuf, len);
+		mutex_unlock(&ci->lock);
+		return -EIO;
+	}
 	read_block(ci, 0x12, ebuf, len);
 	ci->dr = 0;
 	mutex_unlock(&ci->lock);
-
 	return len;
 }
 
+#ifdef BUFFER_MODE
+
 static int write_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount)
 {
 	struct cxd *ci = ca->data;
 
+	if (ci->write_busy)
+		return -EAGAIN;
 	mutex_lock(&ci->lock);
 	dev_info(&ci->i2c->dev, "write_data %d\n", ecount);
 	write_reg(ci, 0x0d, ecount>>8);
 	write_reg(ci, 0x0e, ecount&0xff);
 	write_block(ci, 0x11, ebuf, ecount);
+	ci->write_busy = 1;
 	mutex_unlock(&ci->lock);
 	return ecount;
 }
diff --git a/drivers/staging/media/cxd2099/cxd2099.h b/drivers/staging/media/cxd2099/cxd2099.h
index 0eb607c..f4b29b1 100644
--- a/drivers/staging/media/cxd2099/cxd2099.h
+++ b/drivers/staging/media/cxd2099/cxd2099.h
@@ -30,8 +30,10 @@
 struct cxd2099_cfg {
 	u32 bitrate;
 	u8  adr;
-	u8  polarity:1;
-	u8  clock_mode:1;
+	u8  polarity;
+	u8  clock_mode;
+
+	u32 max_i2c;
 };
 
 #if defined(CONFIG_DVB_CXD2099) || \
-- 
2.7.4

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

* [PATCH 5/7] [media] ddbridge/ddbridge-core.c: Set maximum cxd2099 block size to 512
  2017-05-07 20:51 [PATCH 0/7] Add block read/write to en50221 CAM functions Jasmin J.
                   ` (3 preceding siblings ...)
  2017-05-07 20:51 ` [PATCH 4/7] [staging] cxd2099/cxd2099.c/.h: Fixed buffer mode Jasmin J.
@ 2017-05-07 20:51 ` Jasmin J.
  2017-06-24 19:07   ` Mauro Carvalho Chehab
  2017-05-07 20:51 ` [PATCH 6/7] [staging] cxd2099/cxd2099.c: Removed useless printing in cxd2099 driver Jasmin J.
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 19+ messages in thread
From: Jasmin J. @ 2017-05-07 20:51 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, max.kellermann, rjkm, d.scheller, jasmin

From: Jasmin Jessich <jasmin@anw.at>

Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
---
 drivers/media/pci/ddbridge/ddbridge-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index 340cff0..c96b7f9 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -1036,6 +1036,7 @@ static struct cxd2099_cfg cxd_cfg = {
 	.adr     =  0x40,
 	.polarity = 1,
 	.clock_mode = 1,
+	.max_i2c = 512,
 };
 
 static int ddb_ci_attach(struct ddb_port *port)
-- 
2.7.4

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

* [PATCH 6/7] [staging] cxd2099/cxd2099.c: Removed useless printing in cxd2099 driver
  2017-05-07 20:51 [PATCH 0/7] Add block read/write to en50221 CAM functions Jasmin J.
                   ` (4 preceding siblings ...)
  2017-05-07 20:51 ` [PATCH 5/7] [media] ddbridge/ddbridge-core.c: Set maximum cxd2099 block size to 512 Jasmin J.
@ 2017-05-07 20:51 ` Jasmin J.
  2017-06-24 19:12   ` Mauro Carvalho Chehab
  2017-05-07 20:51 ` [PATCH 7/7] [staging] cxd2099/cxd2099.c: Activate cxd2099 buffer mode Jasmin J.
  2017-06-07 15:57 ` [PATCH 0/7] Add block read/write to en50221 CAM functions Mauro Carvalho Chehab
  7 siblings, 1 reply; 19+ messages in thread
From: Jasmin J. @ 2017-05-07 20:51 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, max.kellermann, rjkm, d.scheller, jasmin

From: Jasmin Jessich <jasmin@anw.at>

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
---
 drivers/staging/media/cxd2099/cxd2099.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c
index ac01433..64de129 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -231,7 +231,6 @@ static int write_block(struct cxd *ci, u8 adr, u8 *data, u16 n)
 		status = i2c_write_reg(ci->i2c, ci->cfg.adr, 0, adr);
 	if (status)
 		return status;
-	dev_info(&ci->i2c->dev, "write_block %d\n", n);
 
 	ci->lastaddress = adr;
 	buf[0] = 1;
@@ -240,7 +239,6 @@ static int write_block(struct cxd *ci, u8 adr, u8 *data, u16 n)
 
 		if (ci->cfg.max_i2c && (len + 1 > ci->cfg.max_i2c))
 			len = ci->cfg.max_i2c - 1;
-		dev_info(&ci->i2c->dev, "write %d\n", len);
 		memcpy(buf + 1, data, len);
 		status = i2c_write(ci->i2c, ci->cfg.adr, buf, len + 1);
 		if (status)
@@ -570,14 +568,11 @@ static int campoll(struct cxd *ci)
 		return 0;
 	write_reg(ci, 0x05, istat);
 
-	if (istat&0x40) {
+	if (istat&0x40)
 		ci->dr = 1;
-		dev_info(&ci->i2c->dev, "DR\n");
-	}
-	if (istat&0x20) {
+
+	if (istat&0x20)
 		ci->write_busy = 0;
-		dev_info(&ci->i2c->dev, "WC\n");
-	}
 
 	if (istat&2) {
 		u8 slotstat;
@@ -631,7 +626,6 @@ static int read_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount)
 	campoll(ci);
 	mutex_unlock(&ci->lock);
 
-	dev_info(&ci->i2c->dev, "read_data\n");
 	if (!ci->dr)
 		return 0;
 
@@ -660,7 +654,6 @@ static int write_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount)
 	if (ci->write_busy)
 		return -EAGAIN;
 	mutex_lock(&ci->lock);
-	dev_info(&ci->i2c->dev, "write_data %d\n", ecount);
 	write_reg(ci, 0x0d, ecount>>8);
 	write_reg(ci, 0x0e, ecount&0xff);
 	write_block(ci, 0x11, ebuf, ecount);
-- 
2.7.4

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

* [PATCH 7/7] [staging] cxd2099/cxd2099.c: Activate cxd2099 buffer mode
  2017-05-07 20:51 [PATCH 0/7] Add block read/write to en50221 CAM functions Jasmin J.
                   ` (5 preceding siblings ...)
  2017-05-07 20:51 ` [PATCH 6/7] [staging] cxd2099/cxd2099.c: Removed useless printing in cxd2099 driver Jasmin J.
@ 2017-05-07 20:51 ` Jasmin J.
  2017-06-24 19:09   ` Mauro Carvalho Chehab
  2017-06-07 15:57 ` [PATCH 0/7] Add block read/write to en50221 CAM functions Mauro Carvalho Chehab
  7 siblings, 1 reply; 19+ messages in thread
From: Jasmin J. @ 2017-05-07 20:51 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, max.kellermann, rjkm, d.scheller, jasmin

From: Jasmin Jessich <jasmin@anw.at>

Now the cxd2099 buffer mode is activated, but can be deactivated by
setting BUFFER_MODE to 0 at the compiler command line or by editiing
the file.

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
---
 drivers/staging/media/cxd2099/cxd2099.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c
index 64de129..dcad557 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -33,7 +33,9 @@
 
 #include "cxd2099.h"
 
-/* #define BUFFER_MODE 1 */
+#ifndef BUFFER_MODE
+#define BUFFER_MODE 1
+#endif
 
 static int read_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount);
 
-- 
2.7.4

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

* Re: [PATCH 0/7] Add block read/write to en50221 CAM functions
  2017-05-07 20:51 [PATCH 0/7] Add block read/write to en50221 CAM functions Jasmin J.
                   ` (6 preceding siblings ...)
  2017-05-07 20:51 ` [PATCH 7/7] [staging] cxd2099/cxd2099.c: Activate cxd2099 buffer mode Jasmin J.
@ 2017-06-07 15:57 ` Mauro Carvalho Chehab
  2017-06-07 19:18   ` Jasmin J.
  7 siblings, 1 reply; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2017-06-07 15:57 UTC (permalink / raw)
  To: Jasmin J., rjkm; +Cc: linux-media, max.kellermann, d.scheller

Em Sun,  7 May 2017 22:51:46 +0200
"Jasmin J." <jasmin@anw.at> escreveu:

> From: Jasmin Jessich <jasmin@anw.at>
> 
> These patch series implement a block read/write interface to the en50221
> CAM control functions. The origin of this patches can be found in the
> Digital Devices Git on https://github.com/DigitalDevices/dddvb maintained
> by Ralph Metzler <rjkm@metzlerbros.de>
> 
> The relevant changes concerning dvb-core/dvb_ca_en50221.c/.h and
> cxd2099/cxd2099.c/.h have been extracted from the mentioned repository by
> Daniel Scheller <d.scheller@gmx.net> and committed to his branch on
> https://github.com/herrnst/dddvb-linux-kernel/tree/mediatree/master-cxd2099
> 
> I split the patch set is smaller pieces for easier review, compiled each
> step, fixed code style issues in cxd2099/cxd2099.c/.h (checkpatch.pl) and
> tested the resulting driver on my hardware with the DD DuoFlex CI (single)
> card.
> 
> Please note, that the block read/write functionality is already implemented
> in the currently existing cxd2099/cxd2099.c/.h driver, but deactivated. The
> existing code in this driver is also not functional and has been updated by
> the working implementation from the Digital Devices Git.
> 
> Additionally to the block read/write functions, I merged also two patches
> in the en50221 CAM control state machine, which were existing in the
> Digital Devices Git. This are the first two patches of this series.
> 
> There is another patch series coming soon "Fix coding style in en50221 CAM
> functions" which fixes nearly all the style issues in
> dvb-core/dvb_ca_en50221.c/.h, based on this patch series. So please be
> patient, if any of the dvb_ca_en50221.c/.h might be not 100% checkpatch.pl
> compliant. I tried to keep the original patch code from DD as much as
> possible.
> 
> Apologizes if anything regarding the patch submission is/went wrong, as
> this is my first time contribution of a patch set.
> 
> 
> Jasmin Jessich (7):
>   [media] dvb-core/dvb_ca_en50221.c: State UNINITIALISED instead of INVALID
>   [media] dvb-core/dvb_ca_en50221.c: Increase timeout for link init
>   [media] dvb-core/dvb_ca_en50221.c: Add block read/write functions
>   [staging] cxd2099/cxd2099.c/.h: Fixed buffer mode
>   [media] ddbridge/ddbridge-core.c: Set maximum cxd2099 block size to 512
>   [staging] cxd2099/cxd2099.c: Removed useless printing in cxd2099 driver
>   [staging] cxd2099/cxd2099.c: Activate cxd2099 buffer mode

Hmm... from what I understood, the original author for those patches
is Ralph, right?

Regards,
Mauro

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

* Re: [PATCH 0/7] Add block read/write to en50221 CAM functions
  2017-06-07 15:57 ` [PATCH 0/7] Add block read/write to en50221 CAM functions Mauro Carvalho Chehab
@ 2017-06-07 19:18   ` Jasmin J.
  2017-06-07 22:49     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 19+ messages in thread
From: Jasmin J. @ 2017-06-07 19:18 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, rjkm; +Cc: linux-media, max.kellermann, d.scheller

Hello Mauro!

THX for looking into this!

 > Hmm... from what I understood, the original author for those patches
 > is Ralph, right?
Yes. I re-formatted them into smaller pieces to be easier reviewed.
The goal of this series is to make the Kernel version equal to the official
DD version. But I wrote all of this already in the preamble of the series.

BR,
    Jasmin

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

* Re: [PATCH 0/7] Add block read/write to en50221 CAM functions
  2017-06-07 19:18   ` Jasmin J.
@ 2017-06-07 22:49     ` Mauro Carvalho Chehab
  2017-06-08  7:31       ` Jasmin J.
  0 siblings, 1 reply; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2017-06-07 22:49 UTC (permalink / raw)
  To: Jasmin J.; +Cc: rjkm, linux-media, max.kellermann, d.scheller

Em Wed, 7 Jun 2017 21:18:14 +0200
"Jasmin J." <jasmin@anw.at> escreveu:

> Hello Mauro!
> 
> THX for looking into this!
> 
>  > Hmm... from what I understood, the original author for those patches
>  > is Ralph, right?  
> Yes. I re-formatted them into smaller pieces to be easier reviewed.
> The goal of this series is to make the Kernel version equal to the official
> DD version. But I wrote all of this already in the preamble of the series.

The problem with this series is that, while you're saying it at the
preamble, and the SOB on each patch seems to indicate it, the patches
themselves are tagging you as the author of the patch series, and not Ralph.
See the From: at the first line of each patch on it:

	https://patchwork.linuxtv.org/patch/41193/
	https://patchwork.linuxtv.org/patch/41194/
	https://patchwork.linuxtv.org/patch/41196/
	https://patchwork.linuxtv.org/patch/41197/
	...

It should be, instead:
	From: Ralph Metzler <km@metzlerbros.de>

For all patches he wrote (even if you later rebased or splitted
them).

Thanks,
Mauro

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

* Re: [PATCH 0/7] Add block read/write to en50221 CAM functions
  2017-06-07 22:49     ` Mauro Carvalho Chehab
@ 2017-06-08  7:31       ` Jasmin J.
  2017-06-08  8:44         ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 19+ messages in thread
From: Jasmin J. @ 2017-06-08  7:31 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: rjkm, linux-media, max.kellermann, d.scheller

Hello Mauro!

 > It should be, instead:
 > 	From: Ralph Metzler <km@metzlerbros.de>
I thought it is enough to write him in the Signed-off-by as first.
This From line is automatically generated by Git with Format Patch
and then used by send. However I should change that and my mail program
still accepting it?
I will try.

BR,
    Jasmin

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

* Re: [PATCH 0/7] Add block read/write to en50221 CAM functions
  2017-06-08  7:31       ` Jasmin J.
@ 2017-06-08  8:44         ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2017-06-08  8:44 UTC (permalink / raw)
  To: Jasmin J.; +Cc: rjkm, linux-media, max.kellermann, d.scheller

Em Thu, 8 Jun 2017 09:31:25 +0200
"Jasmin J." <jasmin@anw.at> escreveu:

> Hello Mauro!
> 
>  > It should be, instead:
>  > 	From: Ralph Metzler <km@metzlerbros.de>  
> I thought it is enough to write him in the Signed-off-by as first.

No, it isn't. It is possible to have a patch authored by someone that
didn't sign. We don't usually accept it at the Kernel (on exceptional
cases, we might end accepting patches without SOB), but other projects
that use git may not require SOB.

> This From line is automatically generated by Git with Format Patch
> and then used by send. 

Git should take it from the author's name at your git tree. You
can change it with git filter-branch. Something like:

git filter-branch -f --commit-filter '
        if [ "$GIT_COMMITTER_NAME" = "My Name" ];
        then
                GIT_AUTHOR_NAME="Other Name";
                GIT_AUTHOR_EMAIL="other@email";
                GIT_COMMITTER_EMAIL="my@email";
		GIT_AUTHOR_DATE=$GIT_COMMITTER_DATE;
                git commit-tree "$@";
        else
                git commit-tree "$@";
        fi' tag1..tag2

Btw, you can also use filter-branch to rename things at the code, e. g.:

	git filter-branch -f --tree-filter 'for i in $(git grep -l MEDIA_ENT_T_AV_BRIDGE); do sed s,MEDIA_ENT_T_AV_BRIDGE,MEDIA_ENT_T_AV_DMA,g -i $i; done ' tag2..tag3

(tag1, tag2, tag3 can actually be a changeset hash, a branch and/or a tag)

> However I should change that and my mail program
> still accepting it?
> I will try.
> 
> BR,
>     Jasmin



Thanks,
Mauro

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

* Re: [PATCH 5/7] [media] ddbridge/ddbridge-core.c: Set maximum cxd2099 block size to 512
  2017-05-07 20:51 ` [PATCH 5/7] [media] ddbridge/ddbridge-core.c: Set maximum cxd2099 block size to 512 Jasmin J.
@ 2017-06-24 19:07   ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2017-06-24 19:07 UTC (permalink / raw)
  To: Jasmin J.; +Cc: linux-media, max.kellermann, rjkm, d.scheller

Em Sun,  7 May 2017 22:51:51 +0200
"Jasmin J." <jasmin@anw.at> escreveu:

Please add a description. Why is it needed?

> From: Jasmin Jessich <jasmin@anw.at>
> 
> Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
> Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
> Signed-off-by: Jasmin Jessich <jasmin@anw.at>
> ---
>  drivers/media/pci/ddbridge/ddbridge-core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
> index 340cff0..c96b7f9 100644
> --- a/drivers/media/pci/ddbridge/ddbridge-core.c
> +++ b/drivers/media/pci/ddbridge/ddbridge-core.c
> @@ -1036,6 +1036,7 @@ static struct cxd2099_cfg cxd_cfg = {
>  	.adr     =  0x40,
>  	.polarity = 1,
>  	.clock_mode = 1,
> +	.max_i2c = 512,
>  };
>  
>  static int ddb_ci_attach(struct ddb_port *port)



Thanks,
Mauro

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

* Re: [PATCH 7/7] [staging] cxd2099/cxd2099.c: Activate cxd2099 buffer mode
  2017-05-07 20:51 ` [PATCH 7/7] [staging] cxd2099/cxd2099.c: Activate cxd2099 buffer mode Jasmin J.
@ 2017-06-24 19:09   ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2017-06-24 19:09 UTC (permalink / raw)
  To: Jasmin J.; +Cc: linux-media, max.kellermann, rjkm, d.scheller

Em Sun,  7 May 2017 22:51:53 +0200
"Jasmin J." <jasmin@anw.at> escreveu:

> From: Jasmin Jessich <jasmin@anw.at>
> 
> Now the cxd2099 buffer mode is activated, but can be deactivated by
> setting BUFFER_MODE to 0 at the compiler command line or by editiing
> the file.

Editing the sources to enable a feature doesn't seem nice. If this
feature should be enabled per caller, you should pass a parameter
for the caller driver when binding to it.

> 
> Signed-off-by: Jasmin Jessich <jasmin@anw.at>
> ---
>  drivers/staging/media/cxd2099/cxd2099.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c
> index 64de129..dcad557 100644
> --- a/drivers/staging/media/cxd2099/cxd2099.c
> +++ b/drivers/staging/media/cxd2099/cxd2099.c
> @@ -33,7 +33,9 @@
>  
>  #include "cxd2099.h"
>  
> -/* #define BUFFER_MODE 1 */
> +#ifndef BUFFER_MODE
> +#define BUFFER_MODE 1
> +#endif
>  
>  static int read_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount);
>  



Thanks,
Mauro

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

* Re: [PATCH 6/7] [staging] cxd2099/cxd2099.c: Removed useless printing in cxd2099 driver
  2017-05-07 20:51 ` [PATCH 6/7] [staging] cxd2099/cxd2099.c: Removed useless printing in cxd2099 driver Jasmin J.
@ 2017-06-24 19:12   ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2017-06-24 19:12 UTC (permalink / raw)
  To: Jasmin J.; +Cc: linux-media, max.kellermann, rjkm, d.scheller

Em Sun,  7 May 2017 22:51:52 +0200
"Jasmin J." <jasmin@anw.at> escreveu:

> From: Jasmin Jessich <jasmin@anw.at>

Please provide a description. Wouldn't be better to use, instead, dev_debug()
instead of just removing those?

> 
> Signed-off-by: Jasmin Jessich <jasmin@anw.at>
> ---
>  drivers/staging/media/cxd2099/cxd2099.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c
> index ac01433..64de129 100644
> --- a/drivers/staging/media/cxd2099/cxd2099.c
> +++ b/drivers/staging/media/cxd2099/cxd2099.c
> @@ -231,7 +231,6 @@ static int write_block(struct cxd *ci, u8 adr, u8 *data, u16 n)
>  		status = i2c_write_reg(ci->i2c, ci->cfg.adr, 0, adr);
>  	if (status)
>  		return status;
> -	dev_info(&ci->i2c->dev, "write_block %d\n", n);
>  
>  	ci->lastaddress = adr;
>  	buf[0] = 1;
> @@ -240,7 +239,6 @@ static int write_block(struct cxd *ci, u8 adr, u8 *data, u16 n)
>  
>  		if (ci->cfg.max_i2c && (len + 1 > ci->cfg.max_i2c))
>  			len = ci->cfg.max_i2c - 1;
> -		dev_info(&ci->i2c->dev, "write %d\n", len);
>  		memcpy(buf + 1, data, len);
>  		status = i2c_write(ci->i2c, ci->cfg.adr, buf, len + 1);
>  		if (status)
> @@ -570,14 +568,11 @@ static int campoll(struct cxd *ci)
>  		return 0;
>  	write_reg(ci, 0x05, istat);
>  
> -	if (istat&0x40) {
> +	if (istat&0x40)
>  		ci->dr = 1;
> -		dev_info(&ci->i2c->dev, "DR\n");
> -	}
> -	if (istat&0x20) {
> +
> +	if (istat&0x20)
>  		ci->write_busy = 0;
> -		dev_info(&ci->i2c->dev, "WC\n");
> -	}
>  
>  	if (istat&2) {
>  		u8 slotstat;
> @@ -631,7 +626,6 @@ static int read_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount)
>  	campoll(ci);
>  	mutex_unlock(&ci->lock);
>  
> -	dev_info(&ci->i2c->dev, "read_data\n");
>  	if (!ci->dr)
>  		return 0;
>  
> @@ -660,7 +654,6 @@ static int write_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount)
>  	if (ci->write_busy)
>  		return -EAGAIN;
>  	mutex_lock(&ci->lock);
> -	dev_info(&ci->i2c->dev, "write_data %d\n", ecount);
>  	write_reg(ci, 0x0d, ecount>>8);
>  	write_reg(ci, 0x0e, ecount&0xff);
>  	write_block(ci, 0x11, ebuf, ecount);



Thanks,
Mauro

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

* Re: [PATCH 3/7] [media] dvb-core/dvb_ca_en50221.c: Add block read/write functions
  2017-05-07 20:51 ` [PATCH 3/7] [media] dvb-core/dvb_ca_en50221.c: Add block read/write functions Jasmin J.
@ 2017-06-24 19:16   ` Mauro Carvalho Chehab
  2017-06-24 19:36     ` Jasmin J.
  0 siblings, 1 reply; 19+ messages in thread
From: Mauro Carvalho Chehab @ 2017-06-24 19:16 UTC (permalink / raw)
  To: Jasmin J.; +Cc: linux-media, max.kellermann, rjkm, d.scheller

Em Sun,  7 May 2017 22:51:49 +0200
"Jasmin J." <jasmin@anw.at> escreveu:

> From: Jasmin Jessich <jasmin@anw.at>
> 
> Some lower level drivers may work better when sending blocks of data instead
> byte per byte. For this we need new function pointers in the dvb_ca_en50221
> protocol structure (read_data, write_data) and the protocol needs to execute
> them, if they are defined.
> Block data transmission is done in all states expect LINKINIT.
> 
> Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
> Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
> Signed-off-by: Jasmin Jessich <jasmin@anw.at>

Please check the patch with checkpatch.pl:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#16: 
Some lower level drivers may work better when sending blocks of data instead

WARNING: line over 80 characters
#54: FILE: drivers/media/dvb-core/dvb_ca_en50221.c:649:
+	if (ca->pub->read_data && (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_LINKINIT)) {

...



> ---
>  drivers/media/dvb-core/dvb_ca_en50221.c | 117 ++++++++++++++++++--------------
>  drivers/media/dvb-core/dvb_ca_en50221.h |   7 ++
>  2 files changed, 73 insertions(+), 51 deletions(-)
> 
> diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
> index 1cdd80a..cc709c9 100644
> --- a/drivers/media/dvb-core/dvb_ca_en50221.c
> +++ b/drivers/media/dvb-core/dvb_ca_en50221.c
> @@ -646,66 +646,78 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb
>  		}
>  	}
>  
> -	/* check if there is data available */
> -	if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
> -		goto exit;
> -	if (!(status & STATUSREG_DA)) {
> -		/* no data */
> -		status = 0;
> -		goto exit;
> -	}
> -
> -	/* read the amount of data */
> -	if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_SIZE_HIGH)) < 0)
> -		goto exit;
> -	bytes_read = status << 8;
> -	if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_SIZE_LOW)) < 0)
> -		goto exit;
> -	bytes_read |= status;
> +	if (ca->pub->read_data && (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_LINKINIT)) {
> +		if (ebuf == NULL)
> +			status = ca->pub->read_data(ca->pub, slot, buf, sizeof(buf));
> +		else
> +			status = ca->pub->read_data(ca->pub, slot, buf, ecount);
> +		if (status < 0)
> +			return status;
> +		bytes_read =  status;
> +		if (status == 0)
> +			goto exit;
> +	} else {
>  
> -	/* check it will fit */
> -	if (ebuf == NULL) {
> -		if (bytes_read > ca->slot_info[slot].link_buf_size) {
> -			pr_err("dvb_ca adapter %d: CAM tried to send a buffer larger than the link buffer size (%i > %i)!\n",
> -			       ca->dvbdev->adapter->num, bytes_read,
> -			       ca->slot_info[slot].link_buf_size);
> -			ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
> -			status = -EIO;
> +		/* check if there is data available */
> +		if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
>  			goto exit;
> -		}
> -		if (bytes_read < 2) {
> -			pr_err("dvb_ca adapter %d: CAM sent a buffer that was less than 2 bytes!\n",
> -			       ca->dvbdev->adapter->num);
> -			ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
> -			status = -EIO;
> +		if (!(status & STATUSREG_DA)) {
> +			/* no data */
> +			status = 0;
>  			goto exit;
>  		}
> -	} else {
> -		if (bytes_read > ecount) {
> -			pr_err("dvb_ca adapter %d: CAM tried to send a buffer larger than the ecount size!\n",
> -			       ca->dvbdev->adapter->num);
> -			status = -EIO;
> +
> +		/* read the amount of data */
> +		if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_SIZE_HIGH)) < 0)
> +			goto exit;
> +		bytes_read = status << 8;
> +		if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_SIZE_LOW)) < 0)
>  			goto exit;
> +		bytes_read |= status;
> +
> +		/* check it will fit */
> +		if (ebuf == NULL) {
> +			if (bytes_read > ca->slot_info[slot].link_buf_size) {
> +				pr_err("dvb_ca adapter %d: CAM tried to send a buffer larger than the link buffer size (%i > %i)!\n",
> +				       ca->dvbdev->adapter->num, bytes_read, ca->slot_info[slot].link_buf_size);
> +				ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
> +				status = -EIO;
> +				goto exit;
> +			}
> +			if (bytes_read < 2) {
> +				pr_err("dvb_ca adapter %d: CAM sent a buffer that was less than 2 bytes!\n",
> +				       ca->dvbdev->adapter->num);
> +				ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
> +				status = -EIO;
> +				goto exit;
> +			}
> +		} else {
> +			if (bytes_read > ecount) {
> +				pr_err("dvb_ca adapter %d: CAM tried to send a buffer larger than the ecount size!\n",
> +				       ca->dvbdev->adapter->num);
> +				status = -EIO;
> +				goto exit;
> +			}
>  		}
> -	}
>  
> -	/* fill the buffer */
> -	for (i = 0; i < bytes_read; i++) {
> -		/* read byte and check */
> -		if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_DATA)) < 0)
> -			goto exit;
> +		/* fill the buffer */
> +		for (i = 0; i < bytes_read; i++) {
> +			/* read byte and check */
> +			if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_DATA)) < 0)
> +				goto exit;
>  
> -		/* OK, store it in the buffer */
> -		buf[i] = status;
> -	}
> +			/* OK, store it in the buffer */
> +			buf[i] = status;
> +		}
>  
> -	/* check for read error (RE should now be 0) */
> -	if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
> -		goto exit;
> -	if (status & STATUSREG_RE) {
> -		ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
> -		status = -EIO;
> -		goto exit;
> +		/* check for read error (RE should now be 0) */
> +		if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
> +			goto exit;
> +		if (status & STATUSREG_RE) {
> +			ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
> +			status = -EIO;
> +			goto exit;
> +		}
>  	}
>  
>  	/* OK, add it to the receive buffer, or copy into external buffer if supplied */
> @@ -757,6 +769,9 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * b
>  	if (bytes_write > ca->slot_info[slot].link_buf_size)
>  		return -EINVAL;
>  
> +	if (ca->pub->write_data && (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_LINKINIT))
> +		return ca->pub->write_data(ca->pub, slot, buf, bytes_write);
> +
>  	/* it is possible we are dealing with a single buffer implementation,
>  	   thus if there is data available for read or if there is even a read
>  	   already in progress, we do nothing but awake the kernel thread to
> diff --git a/drivers/media/dvb-core/dvb_ca_en50221.h b/drivers/media/dvb-core/dvb_ca_en50221.h
> index 1e4bbbd..82617ba 100644
> --- a/drivers/media/dvb-core/dvb_ca_en50221.h
> +++ b/drivers/media/dvb-core/dvb_ca_en50221.h
> @@ -41,6 +41,8 @@
>   * @write_attribute_mem: function for writing attribute memory on the CAM
>   * @read_cam_control:	function for reading the control interface on the CAM
>   * @write_cam_control:	function for reading the control interface on the CAM
> + * @read_data:		function for reading data (block mode)
> + * @write_data:		function for writing data (block mode)
>   * @slot_reset:		function to reset the CAM slot
>   * @slot_shutdown:	function to shutdown a CAM slot
>   * @slot_ts_enable:	function to enable the Transport Stream on a CAM slot
> @@ -66,6 +68,11 @@ struct dvb_ca_en50221 {
>  	int (*write_cam_control)(struct dvb_ca_en50221 *ca,
>  				 int slot, u8 address, u8 value);
>  
> +	int (*read_data)(struct dvb_ca_en50221 *ca,
> +				int slot, u8 *ebuf, int ecount);
> +	int (*write_data)(struct dvb_ca_en50221 *ca,
> +				int slot, u8 *ebuf, int ecount);
> +
>  	int (*slot_reset)(struct dvb_ca_en50221 *ca, int slot);
>  	int (*slot_shutdown)(struct dvb_ca_en50221 *ca, int slot);
>  	int (*slot_ts_enable)(struct dvb_ca_en50221 *ca, int slot);



Thanks,
Mauro

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

* Re: [PATCH 3/7] [media] dvb-core/dvb_ca_en50221.c: Add block read/write functions
  2017-06-24 19:16   ` Mauro Carvalho Chehab
@ 2017-06-24 19:36     ` Jasmin J.
  2017-06-24 20:03       ` Jasmin J.
  0 siblings, 1 reply; 19+ messages in thread
From: Jasmin J. @ 2017-06-24 19:36 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media, max.kellermann, rjkm, d.scheller

Hello Mauro!

> Please check the patch with checkpatch.pl:
I am nearly finished with a V2 series of this set, where I partly changed
some of this issues.
We decided to split the monster thread function into a sub function to make it
more readable and also to overcome the 80 line length limit which gets even
worse because of the additional indention due to this patch.
See: https://www.spinics.net/lists/linux-media/msg116599.html
There you wrote:
  The idea behind patch 04/11 makes sense to me. I'll review it carefully
  after having everything applied.

  Please re-send the first series, making sure that the authorship is
  preserved.

I am nearly finished with the first series and THEN I plan to do parts of the
second series again including the splitting of the thread function.

BR,
   Jasmin

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

* Re: [PATCH 3/7] [media] dvb-core/dvb_ca_en50221.c: Add block read/write functions
  2017-06-24 19:36     ` Jasmin J.
@ 2017-06-24 20:03       ` Jasmin J.
  0 siblings, 0 replies; 19+ messages in thread
From: Jasmin J. @ 2017-06-24 20:03 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media, max.kellermann, rjkm, d.scheller

Hello Mauro!

> We decided to split the monster thread function into a sub function to make
> it more readable and also to overcome the 80 line length limit ...
Sorry I mixed the patches. I will cleanup this patch to make checkpatch silent.

BR,
   Jasmin

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

end of thread, other threads:[~2017-06-24 20:03 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-07 20:51 [PATCH 0/7] Add block read/write to en50221 CAM functions Jasmin J.
2017-05-07 20:51 ` [PATCH 1/7] [media] dvb-core/dvb_ca_en50221.c: State UNINITIALISED instead of INVALID Jasmin J.
2017-05-07 20:51 ` [PATCH 2/7] [media] dvb-core/dvb_ca_en50221.c: Increase timeout for link init Jasmin J.
2017-05-07 20:51 ` [PATCH 3/7] [media] dvb-core/dvb_ca_en50221.c: Add block read/write functions Jasmin J.
2017-06-24 19:16   ` Mauro Carvalho Chehab
2017-06-24 19:36     ` Jasmin J.
2017-06-24 20:03       ` Jasmin J.
2017-05-07 20:51 ` [PATCH 4/7] [staging] cxd2099/cxd2099.c/.h: Fixed buffer mode Jasmin J.
2017-05-07 20:51 ` [PATCH 5/7] [media] ddbridge/ddbridge-core.c: Set maximum cxd2099 block size to 512 Jasmin J.
2017-06-24 19:07   ` Mauro Carvalho Chehab
2017-05-07 20:51 ` [PATCH 6/7] [staging] cxd2099/cxd2099.c: Removed useless printing in cxd2099 driver Jasmin J.
2017-06-24 19:12   ` Mauro Carvalho Chehab
2017-05-07 20:51 ` [PATCH 7/7] [staging] cxd2099/cxd2099.c: Activate cxd2099 buffer mode Jasmin J.
2017-06-24 19:09   ` Mauro Carvalho Chehab
2017-06-07 15:57 ` [PATCH 0/7] Add block read/write to en50221 CAM functions Mauro Carvalho Chehab
2017-06-07 19:18   ` Jasmin J.
2017-06-07 22:49     ` Mauro Carvalho Chehab
2017-06-08  7:31       ` Jasmin J.
2017-06-08  8:44         ` Mauro Carvalho Chehab

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.