/* SPDX-License-Identifier: GPL-2.0-only */1/*2* tc358743 - Toshiba HDMI to CSI-2 bridge3*4* Copyright 2015 Cisco Systems, Inc. and/or its affiliates. All rights reserved.5*/67/*8* References (c = chapter, p = page):9* REF_01 - Toshiba, TC358743XBG (H2C), Functional Specification, Rev 0.6010* REF_02 - Toshiba, TC358743XBG_HDMI-CSI_Tv11p_nm.xls11*/1213#ifndef _TC358743_14#define _TC358743_1516enum tc358743_ddc5v_delays {17DDC5V_DELAY_0_MS,18DDC5V_DELAY_50_MS,19DDC5V_DELAY_100_MS,20DDC5V_DELAY_200_MS,21};2223enum tc358743_hdmi_detection_delay {24HDMI_MODE_DELAY_0_MS,25HDMI_MODE_DELAY_25_MS,26HDMI_MODE_DELAY_50_MS,27HDMI_MODE_DELAY_100_MS,28};2930struct tc358743_platform_data {31/* System clock connected to REFCLK (pin H5) */32u32 refclk_hz; /* 26 MHz, 27 MHz or 42 MHz */3334/* DDC +5V debounce delay to avoid spurious interrupts when the cable35* is connected.36* Sets DDC5V_MODE in register DDC_CTL.37* Default: DDC5V_DELAY_0_MS38*/39enum tc358743_ddc5v_delays ddc5v_delay;4041bool enable_hdcp;4243/*44* The FIFO size is 512x32, so Toshiba recommend to set the default FIFO45* level to somewhere in the middle (e.g. 300), so it can cover speed46* mismatches in input and output ports.47*/48u16 fifo_level;4950/* Bps pr lane is (refclk_hz / pll_prd) * pll_fbd */51u16 pll_prd;52u16 pll_fbd;5354/* CSI55* Calculate CSI parameters with REF_02 for the highest resolution your56* CSI interface can handle. The driver will adjust the number of CSI57* lanes in use according to the pixel clock.58*59* The values in brackets are calculated with REF_02 when the number of60* bps pr lane is 823.5 MHz, and can serve as a starting point.61*/62u32 lineinitcnt; /* (0x00001770) */63u32 lptxtimecnt; /* (0x00000005) */64u32 tclk_headercnt; /* (0x00001d04) */65u32 tclk_trailcnt; /* (0x00000000) */66u32 ths_headercnt; /* (0x00000505) */67u32 twakeup; /* (0x00004650) */68u32 tclk_postcnt; /* (0x00000000) */69u32 ths_trailcnt; /* (0x00000004) */70u32 hstxvregcnt; /* (0x00000005) */7172/* DVI->HDMI detection delay to avoid unnecessary switching between DVI73* and HDMI mode.74* Sets HDMI_DET_V in register HDMI_DET.75* Default: HDMI_MODE_DELAY_0_MS76*/77enum tc358743_hdmi_detection_delay hdmi_detection_delay;7879/* Reset PHY automatically when TMDS clock goes from DC to AC.80* Sets PHY_AUTO_RST2 in register PHY_CTL2.81* Default: false82*/83bool hdmi_phy_auto_reset_tmds_detected;8485/* Reset PHY automatically when TMDS clock passes 21 MHz.86* Sets PHY_AUTO_RST3 in register PHY_CTL2.87* Default: false88*/89bool hdmi_phy_auto_reset_tmds_in_range;9091/* Reset PHY automatically when TMDS clock is detected.92* Sets PHY_AUTO_RST4 in register PHY_CTL2.93* Default: false94*/95bool hdmi_phy_auto_reset_tmds_valid;9697/* Reset HDMI PHY automatically when hsync period is out of range.98* Sets H_PI_RST in register HV_RST.99* Default: false100*/101bool hdmi_phy_auto_reset_hsync_out_of_range;102103/* Reset HDMI PHY automatically when vsync period is out of range.104* Sets V_PI_RST in register HV_RST.105* Default: false106*/107bool hdmi_phy_auto_reset_vsync_out_of_range;108};109110/* custom controls */111/* Audio sample rate in Hz */112#define TC358743_CID_AUDIO_SAMPLING_RATE (V4L2_CID_USER_TC358743_BASE + 0)113/* Audio present status */114#define TC358743_CID_AUDIO_PRESENT (V4L2_CID_USER_TC358743_BASE + 1)115116#endif117118119