2018-04-26 06:34:53

by Takiguchi, Yasunari

[permalink] [raw]
Subject: [PATCH 0/3] [media] cxd2880: modified structure declaration and optimized the driver

From: Yasunari Takiguchi <[email protected]>

Hi,

This is the update patch for patch Sony CXD2880 DVB-T2/T tuner +
demodulator driver.

We modified how to declare structure and
optimized spi drive current and
signal lock condition check part for BER/PER measure
to ensure BER/PER are stable.

The change history of this patch series is as below.

[Change list]
(1)The detail change items of each files are as below.
[PATCH 1/3]
drivers/media/spi/cxd2880-spi.c
-modified how to declare spi_transfer structure

[PATCH 2/3]
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c
-reduced the SPI output drive current
-optimized signal lock condition check part for BER/PER measure
to ensure BER/PER are stable

[PATCH 3/3]
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h
-updated version information

Thanks,
Takiguchi
---
drivers/media/spi/cxd2880-spi.c | 8 +++-----
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c | 14 ++++++++++++--
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h | 4 ++--

3 files changed, 17 insertions(+), 9 deletions(-)

2.15.1



2018-04-26 06:36:53

by Takiguchi, Yasunari

[permalink] [raw]
Subject: [PATCH 1/3] [media] cxd2880-spi: Modified how to declare structure

From: Yasunari Takiguchi <[email protected]>

This is the modification of structure declaration for spi_transfer.

Signed-off-by: Yasunari Takiguchi <[email protected]>
Signed-off-by: Masayuki Yamamoto <[email protected]>
Signed-off-by: Hideki Nozawa <[email protected]>
Signed-off-by: Kota Yonezawa <[email protected]>
Signed-off-by: Toshihiko Matsumoto <[email protected]>
Signed-off-by: Satoshi Watanabe <[email protected]>
---
[Change list]
drivers/media/spi/cxd2880-spi.c
-modified how to declare spi_transfer structure

drivers/media/spi/cxd2880-spi.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/media/spi/cxd2880-spi.c b/drivers/media/spi/cxd2880-spi.c
index 4df3bd312f48..754940f7e964 100644
--- a/drivers/media/spi/cxd2880-spi.c
+++ b/drivers/media/spi/cxd2880-spi.c
@@ -60,14 +60,13 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int cxd2880_write_spi(struct spi_device *spi, u8 *data, u32 size)
{
struct spi_message msg;
- struct spi_transfer tx;
+ struct spi_transfer tx = {};

if (!spi || !data) {
pr_err("invalid arg\n");
return -EINVAL;
}

- memset(&tx, 0, sizeof(tx));
tx.tx_buf = data;
tx.len = size;

@@ -130,7 +129,7 @@ static int cxd2880_spi_read_ts(struct spi_device *spi,
int ret;
u8 data[3];
struct spi_message message;
- struct spi_transfer transfer[2];
+ struct spi_transfer transfer[2] = {};

if (!spi || !read_data || !packet_num) {
pr_err("invalid arg\n");
@@ -146,7 +145,6 @@ static int cxd2880_spi_read_ts(struct spi_device *spi,
data[2] = packet_num;

spi_message_init(&message);
- memset(transfer, 0, sizeof(transfer));

transfer[0].len = 3;
transfer[0].tx_buf = data;
@@ -383,7 +381,7 @@ static int cxd2880_start_feed(struct dvb_demux_feed *feed)
}
}
if (i == CXD2880_MAX_FILTER_SIZE) {
- pr_err("PID filter is full. Assumed bug.\n");
+ pr_err("PID filter is full.\n");
return -EINVAL;
}
if (!dvb_spi->all_pid_feed_count)
--
2.15.1


2018-04-26 06:38:20

by Takiguchi, Yasunari

[permalink] [raw]
Subject: [PATCH 2/3] [media] cxd2880:Optimized spi drive current and BER/PER set/get condition

From: Yasunari Takiguchi <[email protected]>

This is the optimization for SPI drive current and
signal lock condition check part for BER/PER measure
to ensure BER/PER are stable

Signed-off-by: Yasunari Takiguchi <[email protected]>
Signed-off-by: Masayuki Yamamoto <[email protected]>
Signed-off-by: Hideki Nozawa <[email protected]>
Signed-off-by: Kota Yonezawa <[email protected]>
Signed-off-by: Toshihiko Matsumoto <[email protected]>
Signed-off-by: Satoshi Watanabe <[email protected]>
---

[Change list]
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c
-reduced the SPI output drive current
-optimized signal lock condition check part for BER/PER measure
to ensure BER/PER are stable

drivers/media/dvb-frontends/cxd2880/cxd2880_top.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c b/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c
index d474dc1b05da..bd9101e246d5 100644
--- a/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c
+++ b/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c
@@ -520,6 +520,15 @@ static int cxd2880_init(struct dvb_frontend *fe)
pr_err("cxd2880 integ init failed %d\n", ret);
return ret;
}
+
+ ret = cxd2880_tnrdmd_set_cfg(&priv->tnrdmd,
+ CXD2880_TNRDMD_CFG_TSPIN_CURRENT,
+ 0x00);
+ if (ret) {
+ mutex_unlock(priv->spi_mutex);
+ pr_err("cxd2880 set config failed %d\n", ret);
+ return ret;
+ }
mutex_unlock(priv->spi_mutex);

pr_debug("OK.\n");
@@ -1126,7 +1135,7 @@ static int cxd2880_get_stats(struct dvb_frontend *fe,
priv = fe->demodulator_priv;
c = &fe->dtv_property_cache;

- if (!(status & FE_HAS_LOCK)) {
+ if (!(status & FE_HAS_LOCK) || !(status & FE_HAS_CARRIER)) {
c->pre_bit_error.len = 1;
c->pre_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
c->pre_bit_count.len = 1;
@@ -1345,7 +1354,8 @@ static int cxd2880_read_status(struct dvb_frontend *fe,

pr_debug("status %d\n", *status);

- if (priv->s == 0 && (*status & FE_HAS_LOCK)) {
+ if (priv->s == 0 && (*status & FE_HAS_LOCK) &&
+ (*status & FE_HAS_CARRIER)) {
mutex_lock(priv->spi_mutex);
if (c->delivery_system == SYS_DVBT) {
ret = cxd2880_set_ber_per_period_t(fe);
--
2.15.1


2018-04-26 06:40:05

by Takiguchi, Yasunari

[permalink] [raw]
Subject: [PATCH 3/3] [media] cxd2880: Changed version information

From: Yasunari Takiguchi <[email protected]>

This is the version update for this cxd2880 driver changing.

Signed-off-by: Yasunari Takiguchi <[email protected]>
Signed-off-by: Masayuki Yamamoto <[email protected]>
Signed-off-by: Hideki Nozawa <[email protected]>
Signed-off-by: Kota Yonezawa <[email protected]>
Signed-off-by: Toshihiko Matsumoto <[email protected]>
Signed-off-by: Satoshi Watanabe <[email protected]>
---

[Change list]
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h
-updated version information

drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h b/drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h
index fab55038b37b..c6d6c8dd16a1 100644
--- a/drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h
+++ b/drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h
@@ -7,6 +7,6 @@
* Copyright (C) 2016, 2017, 2018 Sony Semiconductor Solutions Corporation
*/

-#define CXD2880_TNRDMD_DRIVER_VERSION "1.4.1 - 1.0.4"
+#define CXD2880_TNRDMD_DRIVER_VERSION "1.4.1 - 1.0.5"

-#define CXD2880_TNRDMD_DRIVER_RELEASE_DATE "2018-01-17"
+#define CXD2880_TNRDMD_DRIVER_RELEASE_DATE "2018-04-25"
--
2.15.1