2017-10-13 05:43:59

by Takiguchi, Yasunari

[permalink] [raw]
Subject: [PATCH v4 00/12] [dt-bindings] [media] Add document file and driver for Sony CXD2880 DVB-T2/T tuner + demodulator

From: Yasunari Takiguchi <[email protected]>

Hi,

This is the patch series (version 4) of Sony CXD2880 DVB-T2/T tuner +
demodulator driver.The driver supports DVB-API and interfaces through
SPI.

We have tested the driver on Raspberry Pi 3 and got picture and sound
from a media player.

The change history of this patch series is as below.

[Change list]
Changes in V4
(1)Total patch number was changed from 14 to 12.
We put [PATCH v3 12/14], [PATCH v3 13/14] and [PATCH v3 14/14]
in [PATCH v4 12/12].

(2)Removed another file.
These below files were removed because we changed it so that
demodulator does not wait for locking the signal.

[PATCH v4 09/12]
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt.c
-removed
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt.h
-removed
[PATCH v4 11/12]
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt2.c
-removed
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt2.h
-removed

(3)The detail change items of each files are as below.
[PATCH v4 02/12]
drivers/media/spi/cxd2880-spi.c
-removed Camel case
-removed unnecessary initialization at variable declaration
-removed unnecessary brace {}

[PATCH v4 03/12]
drivers/media/dvb-frontends/cxd2880/cxd2880_io.c
-removed unnecessary initialization at variable declaration
-modified how to write consecutive registers

[PATCH v4 04/12]
drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.c
-removed unnecessary initialization at variable declaration

[PATCH v4 05/12]
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.c
-used over 80 columns limit, it makes fine to read codes
-removed unnecessary initialization at variable declaration
-modified how to write consecutive registers
-removed unnecessary brace {}
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.h
-adjusted of indent spaces of macro
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h
-updated version information
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_mon.c
-removed unnecessary brace {}

[PATCH v4 06/12]
drivers/media/dvb-frontends/cxd2880/cxd2880_integ.c
-removed unnecessary initialization at variable declaration

[PATCH v4 07/12]
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c
-modified typo "inavlid" to "invalid" at pr_err
-removed unnecessary initialization at variable declaration
-removed unnecessary brace {}
-changed to use cxd2880_dvbt_tune and cxd2880_dvbt2_tune
instead of cxd2880_integ_dvbt_tune and cxd2880_integ_dvbt2_tune
(because we changed it so that demodulator does not
wait for locking the signal.)

[PATCH v4 08/12]
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt.c
-used over 80 columns limit, it makes fine to read codes
-removed unnecessary initialization at variable declaration
-removed unnecessary brace {}
-modified how to write consecutive registers

[PATCH v4 09/12]
#drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt.c
-cxd2880_integ_dvbt.c file was removed from V4.
#drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt.h
-cxd2880_integ_dvbt.h file was removed from V4.
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt_mon.c
-removed unnecessary initialization at variable declaration
-removed unnecessary brace {}
-changed position of static const (to top part of the file)

[PATCH v4 10/12]
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2.c
-removed unnecessary initialization at variable declaration
-removed unnecessary brace {}
-modified how to write consecutive registers

[PATCH v4 11/12]
#drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt2.c
-cxd2880_integ_dvbt2.c file was removed from V4.
#drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt2.h
-cxd2880_integ_dvbt2.h file was removed from V4.
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2_mon.c
-removed unnecessary initialization at variable declaration
-removed unnecessary brace {}
-changed position of static const (to top part of the file)

[PATCH v4 12/12]
drivers/media/dvb-frontends/cxd2880/Makefile
-removed cxd2880_integ_dvbt2.o and cxd2880_integ_dvbt.o

Changes in V3
(1)Total patch number was changed from 15 to 14,
due to the all files of [PATCH v2 04/15] were removed.
drivers/media/dvb-frontends/cxd2880/cxd2880_math.c
-Removed
drivers/media/dvb-frontends/cxd2880/cxd2880_math.h
-Removed

(2)Removed another file.
drivers/media/dvb-frontends/cxd2880/cxd2880_stdlib.h
-Removed

(3)The detail change items of each files are as below.
[PATCH v3 01/14]
Documentation/devicetree/bindings/media/spi/sony-cxd2880.txt
-no change
[PATCH v3 02/14]
drivers/media/spi/cxd2880-spi.c
-adjusted of indent spaces
-removed unnecessary cast
-changed debugging code
-changed timeout method
-modified coding style of if()
-changed hexadecimal code to lower case.
[PATCH v3 03/14]
drivers/media/dvb-frontends/cxd2880/cxd2880.h
-no change
drivers/media/dvb-frontends/cxd2880/cxd2880_common.c
-changed MASKUPPER/MASKLOWER with GENMASK
drivers/media/dvb-frontends/cxd2880/cxd2880_common.h
-removed definition NULL and SONY_SLEEP
-changed CXD2880_SLEEP to usleep_range
-changed cxd2880_atomic_set to atomic_set
-removed cxd2880_atomic struct and cxd2880_atomic_read
-changed stop-watch function
-modified return code
drivers/media/dvb-frontends/cxd2880/cxd2880_io.c
-removed unnecessary cast
-modified return code
-changed hexadecimal code to lower case.
drivers/media/dvb-frontends/cxd2880/cxd2880_io.h
-modified return code
drivers/media/dvb-frontends/cxd2880/cxd2880_stopwatch_port.c
-changed CXD2880_SLEEP to usleep_range
-changed stop-watch function
-modified return code
#drivers/media/dvb-frontends/cxd2880/cxd2880_stdlib.h
-cxd2880_stdlib.h file was removed from V3.
[PATCH v3 04/14]
drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.c
-removed unnecessary cast
-changed cxd2880_memcpy to memcpy
-modified return code
-changed hexadecimal code to lower case.
drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.h
-modified return code
drivers/media/dvb-frontends/cxd2880/cxd2880_spi.h
-modified return code
drivers/media/dvb-frontends/cxd2880/cxd2880_spi_device.c
-removed unnecessary cast
-modified return code
drivers/media/dvb-frontends/cxd2880/cxd2880_spi_device.h
-modified return code
[PATCH v3 05/14]
drivers/media/dvb-frontends/cxd2880/cxd2880_dtv.h
-removed code relevant to ISDB-T
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.c
-removed unnecessary cast
-removed code relevant to ISDB-T
-changed CXD2880_SLEEP to usleep_range
-changed cxd2880_memset to memset
-changed cxd2880_atomic_set to atomic_set
-modified return code
-modified coding style of if()
-changed to use const values at writing a lot of registers
with a command.
-changed hexadecimal code to lower case.
-adjusted of indent spaces
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.h
-removed code relevant to ISDB-T
-changed cxd2880_atomic struct to atomic_t
-modified return code
-changed hexadecimal code to lower case.
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h
-updated version information
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_mon.c
-changed CXD2880_SLEEP to usleep_range
-removed unnecessary cast
-modified return code
-modified coding style of if()
-changed hexadecimal code to lower case.
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_mon.h
-modified return code
[PATCH v3 06/14]
drivers/media/dvb-frontends/cxd2880/cxd2880_integ.c
-changed cxd2880_atomic_read to atomic_read
-changed cxd2880_atomic_set to atomic_set
-modified return code
-modified coding style of if()
drivers/media/dvb-frontends/cxd2880/cxd2880_integ.h
-modified return code
[PATCH v3 07/14]
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c
-adjusted indent spaces
-modified debugging code
-removed unnecessary cast
-modified return code
-modified coding style of if()
-modified about measurement period of PER/BER.
-changed hexadecimal code to lower case.
[PATCH v3 08/14]
drivers/media/dvb-frontends/cxd2880/cxd2880_dvbt.h
-no change
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt.c
-modified return code
-modified coding style of if()
-changed hexadecimal code to lower case.
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt.h
-modified return code
[PATCH v3 09/14]
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt.c
-changed CXD2880_SLEEP to usleep_range
-chnaged cxd2880_atomic_set to atomic_set
-modified return code
-modified coding style of if()
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt.h
-modified return code
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt_mon.c
-removed unnecessary cast
-changed cxd2880_math_log to intlog10
-changed hexadecimal code to lower case.
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt_mon.h
-modified return code
[PATCH v3 10/14]
drivers/media/dvb-frontends/cxd2880/cxd2880_dvbt2.h
-changed hexadecimal code to lower case.
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2.c
-modified return code
-modified coding style of if()
-changed hexadecimal code to lower case.
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2.h
-modified return code
[PATCH v3 11/14]
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt2.c
-changed CXD2880_SLEEP to usleep_range
-replaced cxd2880_atomic_set to atomic_set
-modified return code
-modified coding style of if()
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt2.h
-modified return code
-changed hexadecimal code to lower case.
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2_mon.c
-removed unnecessary cast
-changed cxd2880_math_log to intlog10
-modified return code
-modified coding style of if()
-changed hexadecimal code to lower case.
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2_mon.h
-modified return code
[PATCH v3 12/14]
drivers/media/dvb-frontends/Makefile
-no change
drivers/media/dvb-frontends/cxd2880/Makefile
-removed cxd2880_math.o
drivers/media/spi/Makefile
-no change
[PATCH v3 13/14]
drivers/media/dvb-frontends/Kconfig
-no change
drivers/media/dvb-frontends/cxd2880/Kconfig
-no change
drivers/media/spi/Kconfig
-no change
[PATCH v3 14/14]
MAINTAINERS
-no change

Changes in V2
(1)[PATCH 2/5], [PATCH 3/5] and [PATCH 4/5] of version 1
were divided to change order and be small size patch.
Total patch number was changed from 5 to 15

<Previous>
The changed or created files of version 1
[PATCH 2/5], [PATCH 3/5] and [PATCH 4/5]:
[PATCH 2/5]
drivers/media/spi/Kconfig
drivers/media/spi/Makefile
drivers/media/spi/cxd2880-spi.c
[PATCH 3/5]
drivers/media/dvb-frontends/Kconfig
drivers/media/dvb-frontends/Makefile
drivers/media/dvb-frontends/cxd2880/Kconfig
drivers/media/dvb-frontends/cxd2880/Makefile
drivers/media/dvb-frontends/cxd2880/cxd2880.h
drivers/media/dvb-frontends/cxd2880/cxd2880_common.c
drivers/media/dvb-frontends/cxd2880/cxd2880_common.h
drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.c
drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.h
drivers/media/dvb-frontends/cxd2880/cxd2880_dtv.h
drivers/media/dvb-frontends/cxd2880/cxd2880_integ.c
drivers/media/dvb-frontends/cxd2880/cxd2880_integ.h
drivers/media/dvb-frontends/cxd2880/cxd2880_io.c
drivers/media/dvb-frontends/cxd2880/cxd2880_io.h
drivers/media/dvb-frontends/cxd2880/cxd2880_math.c
drivers/media/dvb-frontends/cxd2880/cxd2880_math.h
drivers/media/dvb-frontends/cxd2880/cxd2880_spi.h
drivers/media/dvb-frontends/cxd2880/cxd2880_spi_device.c
drivers/media/dvb-frontends/cxd2880/cxd2880_spi_device.h
drivers/media/dvb-frontends/cxd2880/cxd2880_stdlib.h
drivers/media/dvb-frontends/cxd2880/cxd2880_stopwatch_port.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_mon.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_mon.h
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c
[PATCH 4/5]
drivers/media/dvb-frontends/cxd2880/cxd2880_dvbt.h
drivers/media/dvb-frontends/cxd2880/cxd2880_dvbt2.h
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt.c
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt.h
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt2.c
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt2.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2_mon.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2_mon.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt_mon.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt_mon.h

<New>
The changed or created files of version 2
from [PATCH v2 02/15] to [PATCH v2 14/15]:
[PATCH v2 02/15]
drivers/media/spi/cxd2880-spi.c
[PATCH v2 03/15]
drivers/media/dvb-frontends/cxd2880/cxd2880.h
drivers/media/dvb-frontends/cxd2880/cxd2880_common.c
drivers/media/dvb-frontends/cxd2880/cxd2880_common.h
drivers/media/dvb-frontends/cxd2880/cxd2880_io.c
drivers/media/dvb-frontends/cxd2880/cxd2880_io.h
drivers/media/dvb-frontends/cxd2880/cxd2880_stdlib.h
drivers/media/dvb-frontends/cxd2880/cxd2880_stopwatch_port.c
[PATCH v2 04/15]
drivers/media/dvb-frontends/cxd2880/cxd2880_math.c
drivers/media/dvb-frontends/cxd2880/cxd2880_math.h
[PATCH v2 05/15]
drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.c
drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.h
drivers/media/dvb-frontends/cxd2880/cxd2880_spi.h
drivers/media/dvb-frontends/cxd2880/cxd2880_spi_device.c
drivers/media/dvb-frontends/cxd2880/cxd2880_spi_device.h
[PATCH v2 06/15]
drivers/media/dvb-frontends/cxd2880/cxd2880_dtv.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_mon.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_mon.h
[PATCH v2 07/15]
drivers/media/dvb-frontends/cxd2880/cxd2880_integ.c
drivers/media/dvb-frontends/cxd2880/cxd2880_integ.h
[PATCH v2 08/15]
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c
[PATCH v2 09/15]
drivers/media/dvb-frontends/cxd2880/cxd2880_dvbt.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt.h
[PATCH v2 10/15]
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt.c
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt_mon.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt_mon.h
[PATCH v2 11/15]
drivers/media/dvb-frontends/cxd2880/cxd2880_dvbt2.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2.h
[PATCH v2 12/15]
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt2.c
drivers/media/dvb-frontends/cxd2880/cxd2880_integ_dvbt2.h
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2_mon.c
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2_mon.h
[PATCH v2 13/15]
drivers/media/dvb-frontends/Makefile
drivers/media/dvb-frontends/cxd2880/Makefile
drivers/media/spi/Makefile
[PATCH v2 14/15]
drivers/media/dvb-frontends/Kconfig
drivers/media/dvb-frontends/cxd2880/Kconfig
drivers/media/spi/Kconfig

(2)Modified PID filter setting.
drivers/media/spi/cxd2880-spi.c in [PATCH v2 02/15]

(3)Driver version up
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h
in [PATCH v2 06/15]

Thanks,
Takiguchi
---
Documentation/devicetree/bindings/media/spi/sony-cxd2880.txt | 14 ++++++++++++++
drivers/media/spi/cxd2880-spi.c | 695 ++++++++++++++++++++++++++++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880.h | 46 +++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_common.c | 38 +++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_common.h | 50 ++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_io.c | 89 ++++++++++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_io.h | 71 +++++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_stopwatch_port.c | 60 +++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.c | 146 +++++++++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.h | 40 ++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_spi.h | 51 +++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_spi_device.c | 130 ++++++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_spi_device.h | 43 ++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_dtv.h | 46 +
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.c | 3687 ++++++++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.h | 391 +++
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h | 29 +
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_mon.c | 218 ++
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_mon.h | 52 +
drivers/media/dvb-frontends/cxd2880/cxd2880_integ.c | 98 ++++++++++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_integ.h | 44 ++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c | 2019 +++++++++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_dvbt.h | 91 ++
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt.c | 954 +++++++++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt.h | 62 ++
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt_mon.c | 1201 ++++++++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt_mon.h | 106 ++
drivers/media/dvb-frontends/cxd2880/cxd2880_dvbt2.h | 402 +++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2.c | 1260 ++++++++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2.h | 82 ++
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2_mon.c | 2535 ++++++++++++++++++++
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2_mon.h | 170 ++
MAINTAINERS | 9 +++++++++
drivers/media/dvb-frontends/Kconfig | 2 ++
drivers/media/dvb-frontends/Makefile | 1 +
drivers/media/dvb-frontends/cxd2880/Kconfig | 6 ++++++
drivers/media/dvb-frontends/cxd2880/Makefile | 18 ++++++++++++++++++
drivers/media/spi/Kconfig | 14 ++++++++++++++
drivers/media/spi/Makefile | 5 +++++

39 files changed, 14975 insertions(+)

create mode 100644 Documentation/devicetree/bindings/media/spi/sony-cxd2880.txt
create mode 100644 drivers/media/spi/cxd2880-spi.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_common.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_common.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_io.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_io.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_stopwatch_port.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_spi.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_spi_device.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_spi_device.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_dtv.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_driver_version.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_mon.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_mon.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_integ.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_integ.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_top.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_dvbt.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt_mon.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt_mon.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_dvbt2.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2_mon.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd_dvbt2_mon.h
create mode 100644 drivers/media/dvb-frontends/cxd2880/Kconfig
create mode 100644 drivers/media/dvb-frontends/cxd2880/Makefile
2.11.0


From 1585495611691931193@xxx Thu Nov 30 12:54:03 +0000 2017
X-GM-THRID: 1585457880475547553
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread


2017-10-13 06:06:10

by Takiguchi, Yasunari

[permalink] [raw]
Subject: [PATCH v4 06/12] [media] cxd2880: Add integration layer for the driver

From: Yasunari Takiguchi <[email protected]>

These functions monitor the driver and watch for task completion.
This is part of the Sony CXD2880 DVB-T2/T tuner + demodulator driver.

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]
Changes in V4
drivers/media/dvb-frontends/cxd2880/cxd2880_integ.c
-removed unnecessary initialization at variable declaration

Changes in V3
drivers/media/dvb-frontends/cxd2880/cxd2880_integ.c
-changed cxd2880_atomic_read to atomic_read
-changed cxd2880_atomic_set to atomic_set
-modified return code
-modified coding style of if()
drivers/media/dvb-frontends/cxd2880/cxd2880_integ.h
-modified return code

.../media/dvb-frontends/cxd2880/cxd2880_integ.c | 98 ++++++++++++++++++++++
.../media/dvb-frontends/cxd2880/cxd2880_integ.h | 44 ++++++++++
2 files changed, 142 insertions(+)
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_integ.c
create mode 100644 drivers/media/dvb-frontends/cxd2880/cxd2880_integ.h

diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880_integ.c b/drivers/media/dvb-frontends/cxd2880/cxd2880_integ.c
new file mode 100644
index 000000000000..7264fc355d6b
--- /dev/null
+++ b/drivers/media/dvb-frontends/cxd2880/cxd2880_integ.c
@@ -0,0 +1,98 @@
+/*
+ * cxd2880_integ.c
+ * Sony CXD2880 DVB-T2/T tuner + demodulator driver
+ * integration layer common functions
+ *
+ * Copyright (C) 2016, 2017 Sony Semiconductor Solutions Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; version 2 of the License.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "cxd2880_tnrdmd.h"
+#include "cxd2880_tnrdmd_mon.h"
+#include "cxd2880_integ.h"
+
+int cxd2880_integ_init(struct cxd2880_tnrdmd *tnr_dmd)
+{
+ int ret;
+ struct cxd2880_stopwatch timer;
+ unsigned int elapsed_time = 0;
+ u8 cpu_task_completed = 0;
+
+ if (!tnr_dmd)
+ return -EINVAL;
+
+ ret = cxd2880_tnrdmd_init1(tnr_dmd);
+ if (ret)
+ return ret;
+
+ ret = cxd2880_stopwatch_start(&timer);
+ if (ret)
+ return ret;
+
+ while (1) {
+ ret = cxd2880_stopwatch_elapsed(&timer, &elapsed_time);
+ if (ret)
+ return ret;
+
+ ret =
+ cxd2880_tnrdmd_check_internal_cpu_status(tnr_dmd,
+ &cpu_task_completed);
+ if (ret)
+ return ret;
+
+ if (cpu_task_completed)
+ break;
+
+ if (elapsed_time > CXD2880_TNRDMD_WAIT_INIT_TIMEOUT)
+ return -ETIME;
+ ret =
+ cxd2880_stopwatch_sleep(&timer,
+ CXD2880_TNRDMD_WAIT_INIT_INTVL);
+ if (ret)
+ return ret;
+ }
+
+ ret = cxd2880_tnrdmd_init2(tnr_dmd);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+int cxd2880_integ_cancel(struct cxd2880_tnrdmd *tnr_dmd)
+{
+ if (!tnr_dmd)
+ return -EINVAL;
+
+ atomic_set(&tnr_dmd->cancel, 1);
+
+ return 0;
+}
+
+int cxd2880_integ_check_cancellation(struct cxd2880_tnrdmd *tnr_dmd)
+{
+ if (!tnr_dmd)
+ return -EINVAL;
+
+ if (atomic_read(&tnr_dmd->cancel) != 0)
+ return -ECANCELED;
+
+ return 0;
+}
diff --git a/drivers/media/dvb-frontends/cxd2880/cxd2880_integ.h b/drivers/media/dvb-frontends/cxd2880/cxd2880_integ.h
new file mode 100644
index 000000000000..2b4fe5c3743b
--- /dev/null
+++ b/drivers/media/dvb-frontends/cxd2880/cxd2880_integ.h
@@ -0,0 +1,44 @@
+/*
+ * cxd2880_integ.h
+ * Sony CXD2880 DVB-T2/T tuner + demodulator driver
+ * integration layer common interface
+ *
+ * Copyright (C) 2016, 2017 Sony Semiconductor Solutions Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; version 2 of the License.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef CXD2880_INTEG_H
+#define CXD2880_INTEG_H
+
+#include "cxd2880_tnrdmd.h"
+
+#define CXD2880_TNRDMD_WAIT_INIT_TIMEOUT 500
+#define CXD2880_TNRDMD_WAIT_INIT_INTVL 10
+
+#define CXD2880_TNRDMD_WAIT_AGC_STABLE 100
+
+int cxd2880_integ_init(struct cxd2880_tnrdmd *tnr_dmd);
+
+int cxd2880_integ_cancel(struct cxd2880_tnrdmd *tnr_dmd);
+
+int cxd2880_integ_check_cancellation(struct cxd2880_tnrdmd
+ *tnr_dmd);
+
+#endif
--
2.13.0


From 1583600418383579709@xxx Thu Nov 09 14:50:46 +0000 2017
X-GM-THRID: 1583600418383579709
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread