aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.4/950-0155-media-tc358743-Add-support-for-972Mbit-s-link-freq.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2020-02-29 09:25:20 +0100
committerÁlvaro Fernández Rojas <noltari@gmail.com>2020-02-29 12:50:51 +0100
commita1383655cfaa71609d6236ae0fcf3b6047462b98 (patch)
treec6f123859e0dfcfaa6c1063eda26f27e208d3cac /target/linux/bcm27xx/patches-5.4/950-0155-media-tc358743-Add-support-for-972Mbit-s-link-freq.patch
parenta8aa974a9dfb4cba484dc4c1e4207fd9ec803410 (diff)
downloadupstream-a1383655cfaa71609d6236ae0fcf3b6047462b98.tar.gz
upstream-a1383655cfaa71609d6236ae0fcf3b6047462b98.tar.bz2
upstream-a1383655cfaa71609d6236ae0fcf3b6047462b98.zip
bcm27xx: add linux 5.4 support
Tested on bcm2710 (Raspberry Pi 3B). Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.4/950-0155-media-tc358743-Add-support-for-972Mbit-s-link-freq.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.4/950-0155-media-tc358743-Add-support-for-972Mbit-s-link-freq.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.4/950-0155-media-tc358743-Add-support-for-972Mbit-s-link-freq.patch b/target/linux/bcm27xx/patches-5.4/950-0155-media-tc358743-Add-support-for-972Mbit-s-link-freq.patch
new file mode 100644
index 0000000000..1b8805bf2e
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.4/950-0155-media-tc358743-Add-support-for-972Mbit-s-link-freq.patch
@@ -0,0 +1,79 @@
+From 9a379dd76a0369c09f1b613bdd869b6b0354a0f3 Mon Sep 17 00:00:00 2001
+From: Dave Stevenson <dave.stevenson@raspberrypi.org>
+Date: Wed, 31 Oct 2018 14:57:21 +0000
+Subject: [PATCH] media: tc358743: Add support for 972Mbit/s link freq.
+
+Adds register setups for running the CSI lanes at 972Mbit/s,
+which allows 1080P50 UYVY down 2 lanes.
+
+Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
+---
+ drivers/media/i2c/tc358743.c | 47 +++++++++++++++++++++++++-----------
+ 1 file changed, 33 insertions(+), 14 deletions(-)
+
+--- a/drivers/media/i2c/tc358743.c
++++ b/drivers/media/i2c/tc358743.c
+@@ -1976,6 +1976,7 @@ static int tc358743_probe_of(struct tc35
+ /*
+ * The CSI bps per lane must be between 62.5 Mbps and 1 Gbps.
+ * The default is 594 Mbps for 4-lane 1080p60 or 2-lane 720p60.
++ * 972 Mbps allows 1080P50 UYVY over 2-lane.
+ */
+ bps_pr_lane = 2 * endpoint.link_frequencies[0];
+ if (bps_pr_lane < 62500000U || bps_pr_lane > 1000000000U) {
+@@ -1988,23 +1989,41 @@ static int tc358743_probe_of(struct tc35
+ state->pdata.refclk_hz * state->pdata.pll_prd;
+
+ /*
+- * FIXME: These timings are from REF_02 for 594 Mbps per lane (297 MHz
+- * link frequency). In principle it should be possible to calculate
++ * FIXME: These timings are from REF_02 for 594 or 972 Mbps per lane
++ * (297 MHz or 486 MHz link frequency).
++ * In principle it should be possible to calculate
+ * them based on link frequency and resolution.
+ */
+- if (bps_pr_lane != 594000000U)
++ switch (bps_pr_lane) {
++ default:
+ dev_warn(dev, "untested bps per lane: %u bps\n", bps_pr_lane);
+- state->pdata.lineinitcnt = 0xe80;
+- state->pdata.lptxtimecnt = 0x003;
+- /* tclk-preparecnt: 3, tclk-zerocnt: 20 */
+- state->pdata.tclk_headercnt = 0x1403;
+- state->pdata.tclk_trailcnt = 0x00;
+- /* ths-preparecnt: 3, ths-zerocnt: 1 */
+- state->pdata.ths_headercnt = 0x0103;
+- state->pdata.twakeup = 0x4882;
+- state->pdata.tclk_postcnt = 0x008;
+- state->pdata.ths_trailcnt = 0x2;
+- state->pdata.hstxvregcnt = 0;
++ case 594000000U:
++ state->pdata.lineinitcnt = 0xe80;
++ state->pdata.lptxtimecnt = 0x003;
++ /* tclk-preparecnt: 3, tclk-zerocnt: 20 */
++ state->pdata.tclk_headercnt = 0x1403;
++ state->pdata.tclk_trailcnt = 0x00;
++ /* ths-preparecnt: 3, ths-zerocnt: 1 */
++ state->pdata.ths_headercnt = 0x0103;
++ state->pdata.twakeup = 0x4882;
++ state->pdata.tclk_postcnt = 0x008;
++ state->pdata.ths_trailcnt = 0x2;
++ state->pdata.hstxvregcnt = 0;
++ break;
++ case 972000000U:
++ state->pdata.lineinitcnt = 0x1b58;
++ state->pdata.lptxtimecnt = 0x007;
++ /* tclk-preparecnt: 6, tclk-zerocnt: 40 */
++ state->pdata.tclk_headercnt = 0x2806;
++ state->pdata.tclk_trailcnt = 0x00;
++ /* ths-preparecnt: 6, ths-zerocnt: 8 */
++ state->pdata.ths_headercnt = 0x0806;
++ state->pdata.twakeup = 0x4268;
++ state->pdata.tclk_postcnt = 0x008;
++ state->pdata.ths_trailcnt = 0x5;
++ state->pdata.hstxvregcnt = 0;
++ break;
++ }
+
+ state->reset_gpio = devm_gpiod_get_optional(dev, "reset",
+ GPIOD_OUT_LOW);