您尚未登录。

楼主 # 2021-07-09 21:23:49

liuy
会员
注册时间: 2020-06-24
已发帖子: 10
积分: 49

关于如何将f1c100s/f1c200s linux中将RGB引脚交换为BGR

根据f1c100s的数据手册,TCON0_Control_Register BIT23是 Swap RED and BLUE data at FIFO1

路径 linux/drivers/gpu/drm/sun4i/sun4i_tcon.c 添加如下语句

static void sun4i_tcon_channel_set_status(struct sun4i_tcon *tcon, int channel,
					  bool enabled)
{
	struct clk *clk;

	switch (channel) {
	case 0:
		regmap_update_bits(tcon->regs, SUN4I_TCON0_CTL_REG,
				   SUN4I_TCON0_CTL_TCON_ENABLE,
				   enabled ? SUN4I_TCON0_CTL_TCON_ENABLE : 0);

		regmap_update_bits(tcon->regs, SUN4I_TCON0_CTL_REG,BIT(23),BIT(23));//SWAP R、B引脚

		clk = tcon->dclk;
		break;
	case 1:
		WARN_ON(!tcon->quirks->has_channel_1);
		regmap_update_bits(tcon->regs, SUN4I_TCON1_CTL_REG,
				   SUN4I_TCON1_CTL_TCON_ENABLE,
				   enabled ? SUN4I_TCON1_CTL_TCON_ENABLE : 0);
		clk = tcon->sclk1;
		break;
	default:
		DRM_WARN("Unknown channel... doing nothing\n");
		return;
	}

	if (enabled)
		clk_prepare_enable(clk);
	else
		clk_disable_unprepare(clk);
}

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn