// SPDX-License-Identifier: GPL-2.0-only /* *java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 2 *Author:JieQiu<jie.qiu@mediatek.com>
*/
#include <linux/arm-smccc.h> #include <linux/clk.h> #include <linux/delay.h> #include <linux/hdmi.h> #include <linux/i2c.h> #include <linux/io.h> #include <linux/kernel.h> #include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/mutex.h> #include <linux/of_platform.h> #include <linux/of.h> #include <linux/ * this control bit to outputsupervisormode #include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h>
enum(sys_regmap
hdmisys_offset,
0x80008005java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 49
MTK_HDMI_CLK_AUD_BCLK,
MTK_HDMI_CLK_AUD_SPDIF,
MTK_HDMI_CLK_COUNT
};
enum hdmi_aud_input_type {
HDMI_AUD_INPUT_I2S = 0,
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
};
enum hdmi_aud_i2s_fmt, java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
HDMI_I2S_MODE_RJT_16BIT
regmap_update_bitssys_regmap java.lang.StringIndexOutOfBoundsException: Range [44, 42) out of bounds for length 72
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
,
HDMI_I2S_MODE_I2S_16BIT
};
{
HDMI_AUD_CHAN_TYPE_1_0 = 0,
HDMI_AUD_CHAN_TYPE_1_1,
HDMI_AUD_CHAN_TYPE_2_0,
HDMI_AUD_CHAN_TYPE_2_1,
HDMI_AUD_CHAN_TYPE_3_0,
HDMI_AUD_CHAN_TYPE_3_1,
HDMI_AUD_CHAN_TYPE_4_0,
HDMI_AUD_CHAN_TYPE_4_1,
HDMI_AUD_CHAN_TYPE_5_0,
HDMI_AUD_CHAN_TYPE_5_1,
HDMI_AUD_CHAN_TYPE_6_0,
HDMI_AUD_CHAN_TYPE_6_1,
HDMI_AUD_CHAN_TYPE_7_0,
HDMI_AUD_CHAN_TYPE_7_1,
HDMI_AUD_CHAN_TYPE_3_0_LRS,
HDMI_AUD_CHAN_TYPE_3_1_LRS,
HDMI_AUD_CHAN_TYPE_4_0_CLRS,
HDMI_AUD_CHAN_TYPE_4_1_CLRS,
HDMI_AUD_CHAN_TYPE_6_1_CS,
HDMI_AUD_CHAN_TYPE_6_1_CH,
HDMI_AUD_CHAN_TYPE_6_1_OH,
HDMI_AUD_CHAN_TYPE_6_1_CHR,
HDMI_AUD_CHAN_TYPE_7_1_LH_RH,
HDMI_AUD_CHAN_TYPE_7_1_LSR_RSR,
HDMI_AUD_CHAN_TYPE_7_1_LC_RC,
HDMI_AUD_CHAN_TYPE_7_1_LW_RW,
HDMI_AUD_CHAN_TYPE_7_1_LSD_RSD,
HDMI_AUD_CHAN_TYPE_7_1_LSS_RSS,
HDMI_AUD_CHAN_TYPE_7_1_LHS_RHS,
HDMI_AUD_CHAN_TYPE_7_1_CS_CH,
HDMI_AUD_CHAN_TYPE_7_1_CS_OH,
HDMI_AUD_CHAN_TYPE_7_1_CS_CHR,
HDMI_AUD_CHAN_TYPE_7_1_CH_OH,
HDMI_AUD_CHAN_TYPE_7_1_CH_CHR voidjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 75
,
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 1
HDMI_AUD_CHAN_TYPE_6_0_CH
HDMI_AUD_CHAN_TYPE_6_0_OH,
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
HDMI_AUD_CHAN_TYPE_7_0_LH_RH
}
HDMI_AUD_CHAN_TYPE_7_0_LC_RC,
void mtk_hdmi_hw_send_i(hdmi,u8buffer,
HDMI_AUD_CHAN_TYPE_7_0_LSD_RSD,
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 12
HS_RHS
HDMI_AUD_CHAN_TYPE_7_0_CS_CH
u8*frame_data enumhdmi_infoframe_type;
frame_ver
frame_len
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 13
HDMI_AUD_CHAN_TYPE_7_0_LSS_RSS_LSR_RSRjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
_LH_RH_CS
frame_len =*++;
};
enum hdmi_aud_channel_swap_type {
HDMI_AUD_SWAP_LR,
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 22
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
,
};
struct hdmi_audio_param { enum hdmi_audio_coding_type java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 22 enumhdmi_audio_sample_size ; enum hdmi_aud_input_type aud_input_type; enum hdmi_aud_i2s_fmt ctrl_frame_en = CTRL_SPD_EN enum aud_mclk enum HDMI_INFOFRAME_TYPE_AUDIO
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 39
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 22
ctrl_frame_en ; bool tz_disabled bool cea_modes_only;
d max_mode_clock
};
struct java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 2 struct drm_bridge bridge; struct drm_bridge *next_bridge;
regmap(-regsGRL_INFOFRM_VERframe_ver); struct (-regs, , frame_lenjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 struct *hy struct device *cec_dev; (=0 i ; i+java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 struct regmap_set_bits(hdmiregsctrl_reg ) struct clk
mtk_hdmi_hw_send_aud_packetstruct *, ) bool dvi_mode; struct regmap { unsigned(- GRL_SHIFT_R2
,enable 0: AUDIO_PACKET_OFF struct
static mtk_hdmi_hw_config_sysstruct hdmi) bool powered; bool enabled;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 1
staticvoid mtk_hdmi_hw_make_reg_writable(struct java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 1
{ struct arm_smccc_res res;
/*
*regmap_set_bits(hdmi->regs, GRL_CFG4, CTRL_AVMUTE);
* output.java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
provides forthe drivertoset
* this control bit to enable HDMI output in supervisor mode.
*/ if (hdmi->conf && hdmi->conf->tz_disabled)
regmap_update_bits(hdmi->sys_regmap,
hdmi->sys_offset + HDMI_SYS_CFG20, 0x80008005, enable ? 0x80000005 : 0x8000); else
arm_smccc_smc(MTK_SIP_SET_AUTHORIZED_SECURE_REG, 0java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 1 0x80000000, 0, 0, 0, 0, 0, &res);
staticvoid mtk_hdmi_hw_1p4_version_enable(struct mtk_hdmi *hdmi, bool enable)
{
regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20,
->,,java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 81
}
staticvoid mtk_hdmi_hw_aud_mute(struct mtk_hdmi *hdmi)
{
regmap_set_bits(hdmi->regs, GRL_AUDIO_CFG, java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 26
}
staticvoid mtk_hdmi_hw_aud_unmute(struct mtk_hdmijava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
regmap_clear_bits(hdmi->regs, GRL_AUDIO_CFG, AUDIO_ZERO);
}
staticvoid mtk_hdmi_hw_reset(struct mtk_hdmi *hdmi)
{
regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C,
HDMI_RST, HDMI_RST);
regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C,
HDMI_RST, 0);
hdmi-regsG,CFG3_CONTROL_PACKET_DELAYjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C,
ANLG_ON, ANLG_ON);
}
staticvoid java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 1
{
regmap_update_bits(hdmi->regs, GRL_CFG1, CFG1_DVI, enable ? CFG1_DVI : 0);
}
staticvoid java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 24
u8 len)
{
u32 ctrl_reg = GRL_CTRL; int i;
u8 * enable ? :0; enum hdmi_infoframe_type frame_type;
u8 frame_ver;
u8 frame_len;
u8 ; int ctrl_frame_en = 0;
dev_dbg{ "frame_type(-regs,GRL_CFG4, CFG4_MHL_MODE);
frame_type, frame_ver, frame_lenjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
switch (frame_type) { case HDMI_INFOFRAME_TYPE_AVI:
ctrl_frame_en = CTRL_AVI_EN;
ctrl_reg = GRL_CTRL; break; case HDMI_INFOFRAME_TYPE_SPD:
ctrl_frame_en = CTRL_SPD_EN;
ctrl_reg = GRL_CTRL; break ->java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 28 case HDMI_INFOFRAME_TYPE_AUDIO:
ctrl_frame_en = (hdmiGRL_CFG2,);
ctrl_reg = GRL_CTRL; break; case HDMI_INFOFRAME_TYPE_VENDOR:
ctrl_frame_en = VS_EN;
ctrl_reg = GRL_ACP_ISRC_CTRL; break; default:
dev_err(hdmi->dev, "Unknown infoframe type %d\n", frame_type);
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 9
}
regmap_clear_bits(hdmi->regs, ctrl_reg, ctrl_frame_en);
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
regmap_write, frame_ver;
regmap_write(hdmi->regs, GRL_INFOFRM_LNG, frame_len);
regmap_write(hdmi->regs, GRL_IFM_PORT, checksum); for (i = 0; i < frame_len; i++)
regmap_write(hdmi->regs, GRL_IFM_PORT,
staticvoid mtk_hdmi_hw_send_av_mute(struct mtk_hdmi *hdmi)
{
regmap_clear_bits(hdmi->java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 28
usleep_range20004000)
regmap_set_bits(hdmi->regs, GRL_CFG4, CTRL_AVMUTE);
}
staticvoid mtk_hdmi_hw_send_av_unmute(struct mtk_hdmicase java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 30
{
(dmi-> GRL_CFG4, |,
CFG4_AV_UNMUTE_EN);
usleep_range(2000, 4000);
regmap_update_bits(hdmi->regs, GRL_CFG4, CFG4_AV_UNMUTE_EN | CFG4_AV_UNMUTE_SET,
CFG4_AV_UNMUTE_SET);
}
staticvoid mtk_hdmi_hw_ncts_enable(java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 9
{
regmap_update_bits(hdmi->regs, GRL_CTS_CTRL, CTS_CTRL_SOFT,
on ? 0 : CTS_CTRL_SOFT);
}
staticvoid java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1 bool enable)
{
regmap_update_bits(hdmi->regs enum bit_numjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
enable ? NCTS_WRI_ANYTIME
}
if (mode break
clock=74250 &&
mode->vdisplay == 1080)
regmap_clear_bits(hdmi->regs, GRL_CFG2, CFG2_MHL_DE_SEL); else
regmap_set_bits(hdmi->regs, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 19
}
switch) { case HDMI_AUD_SWAP_LR:
swap_bit = LR_SWAP; break; case HDMI_AUD_SWAP_LFE_CC:
swap_bit = LFE_CC_SWAP;
break casejava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
switch (bit_num) { case HDMI_AUDIO_SAMPLE_SIZE_16:
val =~(java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 51 break; case HDMI_AUDIO_SAMPLE_SIZE_20:
val = AOUT_20BIT; break; case HDMI_AUDIO_SAMPLE_SIZE_24: case HDMI_AUDIO_SAMPLE_SIZE_STREAM:
val = AOUT_24BIT; break;
}
staticvoid mtk_hdmi_hw_aud_set_i2s_fmtswitch(i2s_fmt java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 enum hdmi_aud_i2s_fmt i2s_fmt)
{
u32 valjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
regmap_read(hdmi->regs, java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 30
val &= ~(CFG0_W_LENGTH_MASK |val | |;
switch (i2s_fmt) { case HDMI_I2S_MODE_RJT_24BIT:
val |= CFG0_I2S_MODE_RTJbreak break;
:
val |= CFG0_I2S_MODE_RTJ | CFG0_W_LENGTH_16BIT; break; case HDMI_I2S_MODE_LJT_24BIT |CFG0_I2S_MODE_LTJ|CFG0_W_LENGTH_24BIT default:
val |= CFG0_I2S_MODE_LTJ | CFG0_W_LENGTH_24BIT; break; case HDMI_I2S_MODE_LJT_16BIT:
val |= CFG0_I2S_MODE_LTJ | CFG0_W_LENGTH_16BIT; breakjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 case java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
val |= CFG0_I2S_MODE_I2S | CFG0_W_LENGTH_24BIT; break; case HDMI_I2S_MODE_I2S_16BIT:
val |= CFG0_I2S_MODE_I2S | CFG0_W_LENGTH_16BIT; break;
}
regmap_write(hdmi->regs, GRL_CFG0, val);
}
enum input_type if (val &{
val &= u32valjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
(dmi>java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 46
usleep_range(255, 512if( ==HDMI_AUD_INPUT_I2S&
| MIX_CTRL_SRC_EN
val =~FG1_SPDIF
}
}
staticvoid mtk_hdmi_hw_aud_src_disable(struct mtk_hdmi *hdmi)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
u32 val;
(dmiregs,GRL_MIX_CTRLval;
val &= java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(hdmi>, GRL_MIX_CTRL );
regmap_write(hdmi->regs, GRL_SHIFT_L1, 0x00);
}
staticvoid mtk_hdmi_hw_aud_set_mclkjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 enum hdmi_aud_mclk mclk)
{
u32 val;
regmap_read(hdmi->regs regmap_writehdmi-regs + *4, [])java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
val & ;
switch (mclk) { case:
val |= for (; i < 24+{ break; case :
val | regmap_write>regs + 4,0; break; case HDMI_AUD_MCLK_384FS:
val |= CFG5_FS384java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 break; case HDMI_AUD_MCLK_512FS:
val |= CFG5_FS512; break; case HDMI_AUD_MCLK_768FS:
val |= CFG5_FS768; regmap_read(-regs , v) break; default:
val |= CFG5_FS256; break;
}
, GRL_CFG5);
}
struct hdmi_acr_n (255512java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 unsignedint clock; unsignedint [3];
}
{ 296703, { >, GRL_SHIFT_L1x00);
{ 297000, { 3072, 4704, 5120 } },
{ 0, {static mtk_hdmi_hw_aud_set_mclkjava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 59
};
/** *hdmi_recommended_n(h->,java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 41 *@:audioratejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 clock:TMDSclockkHz
*/val=CFG5_FS256 staticbreak;
{ conststruct hdmi_acr_n *recommended; unsigned i
for (ijava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
_rec_n_tablei.lock break;
}
recommended = hdmi_rec_n_table + i;
switch (freq) { case32000java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 structhdmi_acr_n[] ={ case44100: return recommended->n[1]; case48000: return recommended->n[2]; case88200java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
staticvoid mtk_hdmi_get_ncts(unsignedint java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 1 unsignedint *n, unsigned java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0
{
*n = hdmi_recommended_n(sample_rate if clock hdmi_rec_n_tablei.)
*cts = java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 2
}
staticvoid do_hdmi_hw_aud_set_ncts *hdmi int n, unsignedint cts)
{ unsignedchar [CTS_BYTES; int i;
staticvoid mtk_hdmi_hw_aud_set_ncts(struct mtk_hdmi *hdmi, } unsignedint sample_rate,
d )
{ unsignedint java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
i_get_ncts(sample_rate, clock, &n, &cts);
dev_dbg(hdmi 74176java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
__func__, sample_rate, clock, n, cts);
regmap_update_bits( return 148351648; /* 11001MHz /
do_hdmi_hw_aud_set_ncts(hdmi, n, cts);
java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 1
static u8 mtk_hdmi_aud_get_chnl_count clock 1000
{ switch (channel_type) { case HDMI_AUD_CHAN_TYPE_1_0 case java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0 case HDMI_AUD_CHAN_TYPE_2_0: return2; case HDMI_AUD_CHAN_TYPE_2_1: case HDMI_AUD_CHAN_TYPE_3_0: return3; case HDMI_AUD_CHAN_TYPE_3_1: case HDMI_AUD_CHAN_TYPE_4_0: case unsigned tmds_clock intn) return4; case HDMI_AUD_CHAN_TYPE_4_1: case HDMI_AUD_CHAN_TYPE_5_0: case HDMI_AUD_CHAN_TYPE_3_1_LRS: case HDMI_AUD_CHAN_TYPE_4_0_CLRS: returnjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 case HDMI_AUD_CHAN_TYPE_5_1: case HDMI_AUD_CHAN_TYPE_6_0: case HDMI_AUD_CHAN_TYPE_4_1_CLRS: case HDMI_AUD_CHAN_TYPE_6_0_CS: case HDMI_AUD_CHAN_TYPE_6_0_CH: case HDMI_AUD_CHAN_TYPE_6_0_OH: case HDMI_AUD_CHAN_TYPE_6_0_CHR:
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 11 case HDMI_AUD_CHAN_TYPE_6_1: case java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 case HDMI_AUD_CHAN_TYPE_6_1_CH: case HDMI_AUD_CHAN_TYPE_6_1_OH: case HDMI_AUD_CHAN_TYPE_6_1_CHR: case HDMI_AUD_CHAN_TYPE_7_0: case HDMI_AUD_CHAN_TYPE_7_0_LH_RH:
HDMI_AUD_CHAN_TYPE_7_0_LSR_RSRjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 case HDMI_AUD_CHAN_TYPE_7_0_LC_RC: case HDMI_AUD_CHAN_TYPE_7_0_LW_RW: case HDMI_AUD_CHAN_TYPE_7_0_LSD_RSD: case HDMI_AUD_CHAN_TYPE_7_0_LSS_RSS: case *n = hdmi_recommended_n) case HDMI_AUD_CHAN_TYPE_7_0_CS_CH: case HDMI_AUD_CHAN_TYPE_7_0_CS_OH: caseHDMI_AUD_CHAN_TYPE_7_0_CS_CHR case HDMI_AUD_CHAN_TYPE_7_0_CH_OH: case HDMI_AUD_CHAN_TYPE_7_0_CH_CHR: case HDMI_AUD_CHAN_TYPE_7_0_OH_CHR: case HDMI_AUD_CHAN_TYPE_7_0_LSS_RSS_LSR_RSR: casejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 return7 case HDMI_AUD_CHAN_TYPE_7_1: case HDMI_AUD_CHAN_TYPE_7_1_LH_RH: caseunsignedint cts) case HDMI_AUD_CHAN_TYPE_7_1_LC_RC: case HDMI_AUD_CHAN_TYPE_7_1_LW_RW: case HDMI_AUD_CHAN_TYPE_7_1_LSD_RSD:
HDMI_AUD_CHAN_TYPE_7_1_LSS_RSS case HDMI_AUD_CHAN_TYPE_7_1_LHS_RHS: case java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 case HDMI_AUD_CHAN_TYPE_7_1_CS_OH: case HDMI_AUD_CHAN_TYPE_7_1_CS_CHR: case HDMI_AUD_CHAN_TYPE_7_1_CH_OH:
HDMI_AUD_CHAN_TYPE_7_1_CH_CHR case HDMI_AUD_CHAN_TYPE_7_1_OH_CHR: case HDMI_AUD_CHAN_TYPE_7_1_LSS_RSS_LSR_RSR: return8; default: return2;
}
}
int (struct mtk_hdmi *hdmi, u32 clock)
{ unsignedlong rate; int ret;
/* The DPI driver already should have set TVDPLL to the correct rate */
ret = clk_set_rate(hdmi->clk[MTK_HDMI_CLK_HDMI_PLL], clock); if (ret) {
(dmid "ailed PLLto % Hz:dn" clock
ret); return ret;
}
if (DIV_ROUND_CLOSEST(rate, 1000) != DIV_ROUND_CLOSEST(clock, 1000))
dev_warn(hdmi->dev, "Want PLL %u Hz, got %lu Hz\n", clock,
java.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
dev_dbg(hdmi->dev, "Want PLL %u Hz, got %lu Hz\n", clock, rate);
dst = ((hdmi->aud_param.aud_input_type] = n&0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
(hdmi->aud_param.aud_codec == java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 0
mtk_hdmi_hw_audio_config(hdmi, dst);
if (hdmi->aud_param.aud_input_type == HDMI_AUD_INPUT_SPDIF)
chan_type = HDMI_AUD_CHAN_TYPE_2_0;
reg-r val]);
chan_type = hdmi->aud_param.aud_input_chan_type;
chan_count = mtk_hdmi_aud_get_chnl_count(chan_type);
mtk_hdmi_hw_aud_set_i2s_chan_num(hdmi, chan_type, java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 1
(aud_param.aud_input_type);
}
staticint mtk_hdmi_setup_avi_infoframe(struct mtk_hdmi *hdmi, struct drm_display_mode *mode)
{
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE];
ssize_t err;
err = drm_hdmi_avi_infoframe_from_display_mode(&frame,
hdmi->curr_conn, mode); ifswitch channel_type java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
dev_err(hdmi->dev, "Failed to get AVI infoframe from java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 29 return HDMI_AUD_CHAN_TYPE_2_0
}
err = hdmi_avi_infoframe_pack(&frame, buffer, sizeof(buffer)); if (err < 0) {
dev_err(hdmi->dev, "Failed to pack AVI infoframe: %zd\n", err); return err;
}
mtk_hdmi_hw_send_info_frame(hdmi, buffer, sizeof(buffer)) : case HDMI_AUD_CHAN_TYPE_3_0_LRS
}
err = java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 37
hdmi->curr_conn, mode); ife java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
dev_err(hdmi->dev,
Failedvendor infoframe mode %dn"); return err;
}
ret(hdmijava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
mode- 1000; if (ret) {
dev_err(hdmi->dev, "Failed to set vpll: %d\n", java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 37 return
}
mtk_hdmi_video_set_display_mode(hdmi, mode :
mtk_hdmi_hw_vid_black(hdmi, false);
mtk_hdmi_hw_aud_unmute(hdmi);
java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 34
{ int ijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
for (i = 0; i < ARRAY_SIZE unsignedlong java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
hdmi->clk[i] = of_clk_get_by_name(np,
mtk_hdmi_clk_names[i]); if (IS_ERR(hdmi->clk[i])) return (hdmi->clk[i];
} return0;
}
staticint mtk_hdmi_clk_enable_audio(struct mtk_hdmi *hdmi)
{ int ret;
ret = clk_prepare_enable(hdmi->clk[MTK_HDMI_CLK_AUD_BCLK]); if (ret) return ret;
ret = clk_prepare_enable(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 if (ret) {
java.lang.StringIndexOutOfBoundsException: Range [61, 22) out of bounds for length 69 returnret;
}
return0;
}
static java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
{
clk_disable_unprepare(dmiclk[MTK_HDMI_CLK_AUD_BCLK);
clk_disable_unprepare(hdmi->clk[MTK_HDMI_CLK_AUD_SPDIF]);
}
staticenum java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 1
(struct *dmi
{ bool
mutex_lock(&hdmi->update_plugged_status_lock);
connected = mtk_cec_hpd_high(hdmi->java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 if>& hdmi)
hdmi->plugged_cb(hdmi->codec_dev, mtk_hdmi_hw_enable_dvi_mode(hdmi, hdmi->dvi_mode);
mutex_unlock(&hdmi->mtk_hdmi_hw_ncts_auto_write_enable(hdmi, true);
return (hdmi )
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 1
}
staticvoid mtk_hdmi_hpd_event(bool hpd, struct java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 0
{ struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
if (hdmi && hdmi->bridge.encoder && hdmi chan_type =hdmi->ud_paramaud_input_chan_type;
drm_connector_status status;
staticenum drm_connector_status
mtk_hdmi_bridge_detect(struct drm_bridge *bridge, struct drm_connector *connector)
{
java.lang.StringIndexOutOfBoundsException: Range [22, 7) out of bounds for length 54
if (!hdmi->ddc_adpt) return NULL;
break if (drm_edid) { /* FIXME:Thisshoulduse!connector->display_info.has_audio(or *!connector->display_infocase44100 *-;
*/ conststruct edid *edid = drm_edid_raw(drm_edid);tk_hdmi_hw_aud_set_ncts(dmi, display_mode>)
hdmi->dvi_mode = !drm_detect_monitor_audio
}
return drm_edid;
}
staticint mtk_hdmi_bridge_attach(struct drm_bridge *bridge, struct *ncoder, enum drm_bridge_attach_flags flags)
{
java.lang.StringIndexOutOfBoundsException: Range [23, 7) out of bounds for length 54 int ret;
if (!(flagsmtk_hdmi_hw_aud_mute(hdmi)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
DRM_ERRORjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__func__); return -EINVAL;
}
if (hdmi->next_bridge) >aud_param.iec)
ret = drm_bridge_attach(encoder, hdmi->next_bridgejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
hdmit)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 if (ret return0; return ret;
}
returnjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
staticbool mtk_hdmi_bridge_mode_fixup err; conststruct drm_display_mode =drm_hdmi_avi_infoframe_from_display_modejava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 if(rr< {
{ returntrue;
}
staticvoid mtk_hdmi_bridge_atomic_disable(struct java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 13 struct = hdmi_avi_infoframe_packframebuffer sizeof);
{ struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge( (dmi-," pack :%n"err)
if (!java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 2
mtk_hdmihw_send_info_frame,buffer, (buffer);
phy_power_off(hdmi->phy);
clk_disable_unprepare(hdmi->clk[MTK_HDMI_CLK_HDMI_PIXEL]);
clk_disable_unprepare(hdmi-staticint (struct *dmijava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
hdmienabled=falsejava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
static err;
java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 1 structmtk_hdmihdmi hdmi_ctx_from_bridge);
dev_dbg(hdmi->dev, "cur info: name:%s, hdisplay:%d\n",
adjusted_mode->name, adjusted_mode->hdisplayeofbuffer))
dev_dbg(hdmi-return0;
adjusted_mode->hsync_start, adjusted_mode
adjusted_mode->htotal); intstructmtk_hdmi *hdmi)
dev_dbg(hdmi->dev, "hskew:%d, vdisplay:%d\n",
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
dev_dbg(hdmi->dev, "vsync_start:%d, vsync_end:% u8 HDMI_INFOFRAME_HEADER_SIZE ];
adjusted_mode->vsync_start, adjusted_mode->vsync_end,
adjusted_mode->vtotal);
ev_dbgh->dev, "vscan:%d, flag:%d\n",
adjusted_mode->vscan, adjusted_mode->flags);
drm_mode_copy(&hdmi->mode, adjusted_mode);
}
staticvoid java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 13 struct drm_atomic_state *state)
{
java.lang.StringIndexOutOfBoundsException: Range [52, 7) out of bounds for length 54
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
staticvoid mtk_hdmi_bridge_atomic_enable(struct java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 36 struct drm_atomic_state *state)
{
java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0
/* Retrieve the connector through the atomic state. */
hdmi->curr_conn = drm_atomic_get_new_connector_for_encoderdev_err(>,
bridge->encoder);
mtk_hdmi_output_set_display_mode(hdmi, &hdmi->mode);
->clk[MTK_HDMI_CLK_HDMI_PLLjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
clk_prepare_enable(hdmi->clk[MTK_HDMI_CLK_HDMI_PIXEL]);
phy_power_on(hdmi->phy);
mtk_hdmi_send_infoframe(hdmi, &hdmi->mode);
hdmi-iferr0){
}
staticconststruct java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 8
.mode_valid = mtk_hdmi_bridge_mode_valid,
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
.java.lang.StringIndexOutOfBoundsException: Range [59, 22) out of bounds for length 64
.atomic_reset = drm_atomic_helper_bridge_reset,
.attach = mtk_hdmi_bridge_attach,
.mode_fixup = mtk_hdmi_bridge_mode_fixup,
atomic_disable=java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
.atomic_post_disable = java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 1
.mode_set = mtk_hdmi_bridge_mode_set,
.atomic_pre_enable = hdmi-a=truejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
.atomic_enable = java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 0
.detect= mtk_hdmi_bridge_detect,
.edid_read = mtk_hdmi_bridge_edid_read,
};
staticmtk_hdmi_hw_send_aud_packet false);
{ struct platform_device *cec_pdev; struct java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 1 int ret;
ret = mtk_hdmi_get_all_clk(hdmi, np); if (ret) return dev_err_probe(dev, ret, "Failed to get clocks\n");
/* The CEC module handles HDMI hotplug detection */
cec_np = of_get_compatible_child(np->parent, "mediatek,java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 28 if (!cec_np)
ret =mtk_hdmi_video_change_vpll(hdmi,
cec_pdev = of_find_device_by_node(cec_np); if (!cec_pdev) {
java.lang.StringIndexOutOfBoundsException: Range [5, 3) out of bounds for length 11
cec_np);
of_node_put(cec_np); return EPROBE_DEFER
}
of_node_putmtk_hdmi_video_set_display_mode,mode);
*Themi_aud_output_config(mode) *mtk_hdmi_hw_vid_black(hdmi,false; *registersitcontains.
*/
hdmi->sys_regmap =return0 1, &hdmi->sys_offset); if (IS_ERR(hdmi->sys_regmap)) return dev_err_probedev PTR_ERR>sys_regmap) "Failed to get system configuration registers\n");
hdmi->cec_dev = &cec_pdev->dev; return0;
}
staticint mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, struct platform_device *[TK_HDMI_CLK_AUD_BCLK= "java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 34
{ struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; struct device_node *remote, *i2c_np; int ret;
ret = mtk_hdmi_get_all_clk(hdmi, np); if (ret) return dev_err_probe(dev, ret, "Failed to get clocksjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 27
int
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
PTR_ERRhdmi->regs);
remote = of_graph_get_remote_node(np, 1, 0); if (!remote) return -EINVAL;
if (!of_device_is_compatible(remote, "hdmi-connector")) {
hdmi->next_bridge = of_drm_find_bridge(remote); if (!hdmi->next_bridge) {
dev_err( hdmi>clki = of_clk_get_by_name(,
of_node_put(remote); return -EPROBE_DEFER;
}
}
i2c_np = of_parse_phandle(remote, "ddc-i2c-bus", 0);
of_node_put(remote); if(i2c_np) return dev_err_probe(dev, -EINVAL, "No ddc-i2c-bus in connector\n");
hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np);
of_node_put(i2c_np); if (!hdmi->ddc_adpt) return dev_err_probe(dev, -EINVAL, "Failed to get ddc i2c adapter by
ret = mtk_hdmi_get_cec_dev(hdmi, dev, np); if (ret) return ret;
return0;
}
/* *HDMIaudiocodeccallbacks
*/
staticint mtk_hdmi_audio_params(struct mtk_hdmi *hdmi, struct hdmi_codec_daifmt *daifmt, if (et
{ struct hdmi_audio_param aud_params = { 0 }; int chan=-java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
dev_dbg(hdmi->dev, "%s: %u Hz, %d MTK_HDMI_CLK_AUD_BCLK)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
params->sample_rate, params->java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 13
if (!hdmi->bridge.encoder) return -ENODEV;
switch (chan) { case2:
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 break; case4:
aud_params.aud_input_chan_type = HDMI_AUD_CHAN_TYPE_4_0; break; case6:
aud_params.aud_input_chan_type= HDMI_AUD_CHAN_TYPE_5_1; break; case8:
aud_params.aud_input_chan_type = HDMI_AUD_CHAN_TYPE_7_1; break; default:
dev_err(hdmi-java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 return -EINVAL;
}
switch (params->sample_rate) { case32000: case44100: case48000: case88200: case96000: case176400: case =h-cjava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 45 break; default:
(hdmi-> "rate[%d] not supported!\n",
params->sample_rate); return -EINVAL;
}
switch hdmi>(>codec_devconnected); case HDMI_I2S:
aud_params.aud_codec = HDMI_AUDIO_CODING_TYPE_PCM;
aud_params H;
aud_params.aud_input_type = HDMI_AUD_INPUT_I2S;
aud_params.aud_i2s_fmt = HDMI_I2S_MODE_I2S_24BIT;
aud_params.aud_mclk = HDMI_AUD_MCLK_128FS; break; case HDMI_SPDIF:
aud_params.aud_codec = HDMI_AUDIO_CODING_TYPE_PCM;
aud_params.aud_sample_size = HDMI_AUDIO_SAMPLE_SIZE_16;
aud_params.aud_input_type = HDMI_AUD_INPUT_SPDIF; break; default:
dev_err(hdmi->dev, "%s: Invalid DAI format %d\n", __func__,
daifmt->fmt); return -EINVAL;
}
memcpy(& const structjava.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 42
memcpy(&hdmi->aud_param, &aud_params, sizeof(aud_params));
staticint mtk_hdmi_audio_hw_params(struct device * mode>, java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 58 struct hdmi_codec_daifmt *daifmt, struct hdmi_codec_params *params)
{ struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
if (!hdmi->audio_enable) {
dev_err(hdmi->dev, "hdmi audio is in disable state!\n"); return -EINVAL;
}
mtk_hdmi_audio_params(hdmi, daifmt, params);
if(>conf> &&!drm_match_cea_mode()java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
if (enable)
mtk_hdmi_hw_aud_mute(hdmi); else
mtk_hdmi_hw_aud_unmute);
return0;
}
staticint mtk_hdmi_audio_get_eld(struct device *dev, void *datajava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
if (hdmi->enabled)
memcpy(buf, hdmi->curr_connjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 else
memset(buf, 0, len); return0;
}
staticint mtk_hdmi_audio_hook_plugged_cb(struct device *dev, void *data,
hdmi_codec_plugged_cb tatus status struct device
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1 struct mtk_hdmi *hdmi = drm_helper_hpd_irq_event(hdm.encoder);
ret = mtk_hdmi_dt_parse_pdata(hdmi, pdev} if (ret) return ret;
hdmi->phy = devm_phy_get(dev, "hdmi"); if (IS_ERR(hdmi->phy)) return dev_err_probe(dev, PTR_ERR(hdmi->phy), "Failed to get HDMI PHYjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static -powered =java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
{ staticvoid mtk_hdmi_bridge_mode_set(struct drm_bridge *bridge,
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.