# define VC4_HD_M_ENABLE BIT(0)
#define CEC_CLOCK_FREQ 40000
+#define VC4_HSM_CLOCK 163682864
static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused)
{
* needs to be a bit higher than the pixel clock rate
* (generally 148.5Mhz).
*/
-
- return 163682864;
+ return VC4_HSM_CLOCK;
}
static u32 vc5_hdmi_calc_hsm_clock(struct vc4_hdmi *vc4_hdmi, unsigned long pixel_rate)
struct cec_connector_info conn_info;
struct platform_device *pdev = vc4_hdmi->pdev;
u32 value;
+ u32 clk_cnt;
int ret;
if (!vc4_hdmi->variant->cec_available)
* divider: the hsm_clock rate and this divider setting will
* give a 40 kHz CEC clock.
*/
+ clk_cnt = vc4_hdmi->variant->cec_input_clock / CEC_CLOCK_FREQ;
value |= VC4_HDMI_CEC_ADDR_MASK |
- (4091 << VC4_HDMI_CEC_DIV_CLK_CNT_SHIFT);
+ ((clk_cnt-1) << VC4_HDMI_CEC_DIV_CLK_CNT_SHIFT);
HDMI_WRITE(HDMI_CEC_CNTRL_1, value);
ret = devm_request_threaded_irq(&pdev->dev, platform_get_irq(pdev, 0),
vc4_cec_irq_handler,
static const struct vc4_hdmi_variant bcm2835_variant = {
.max_pixel_clock = 162000000,
+ .cec_input_clock = VC4_HSM_CLOCK,
.audio_available = true,
.cec_available = true,
.registers = vc4_hdmi_fields,
.id = 0,
.audio_available = true,
.max_pixel_clock = 297000000,
+ .cec_input_clock = 27000000,
.registers = vc5_hdmi_hdmi0_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi0_fields),
.phy_lane_mapping = {
.id = 1,
.audio_available = true,
.max_pixel_clock = 297000000,
+ .cec_input_clock = 27000000,
.registers = vc5_hdmi_hdmi1_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi1_fields),
.phy_lane_mapping = {