mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-19 23:28:16 +01:00
rockchip: video: vop: Set different bitwidth for different display mode
Because the bitwidth is different for different display mode, so we need to set them according to demand. Signed-off-by: Eric Gao <eric.gao@rock-chips.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
9f819931e0
commit
8aed0d7751
@ -181,13 +181,11 @@ void rkvop_mode_set(struct rk3288_vop *regs,
|
|||||||
*
|
*
|
||||||
* @dev: VOP device that we want to connect to the display
|
* @dev: VOP device that we want to connect to the display
|
||||||
* @fbbase: Frame buffer address
|
* @fbbase: Frame buffer address
|
||||||
* @l2bpp Log2 of bits-per-pixels for the display
|
|
||||||
* @ep_node: Device tree node to process - this is the offset of an endpoint
|
* @ep_node: Device tree node to process - this is the offset of an endpoint
|
||||||
* node within the VOP's 'port' list.
|
* node within the VOP's 'port' list.
|
||||||
* @return 0 if OK, -ve if something went wrong
|
* @return 0 if OK, -ve if something went wrong
|
||||||
*/
|
*/
|
||||||
int rk_display_init(struct udevice *dev, ulong fbbase,
|
int rk_display_init(struct udevice *dev, ulong fbbase, int ep_node)
|
||||||
enum video_log2_bpp l2bpp, int ep_node)
|
|
||||||
{
|
{
|
||||||
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
|
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
|
||||||
const void *blob = gd->fdt_blob;
|
const void *blob = gd->fdt_blob;
|
||||||
@ -199,6 +197,7 @@ int rk_display_init(struct udevice *dev, ulong fbbase,
|
|||||||
int ret, remote, i, offset;
|
int ret, remote, i, offset;
|
||||||
struct display_plat *disp_uc_plat;
|
struct display_plat *disp_uc_plat;
|
||||||
struct clk clk;
|
struct clk clk;
|
||||||
|
enum video_log2_bpp l2bpp;
|
||||||
|
|
||||||
vop_id = fdtdec_get_int(blob, ep_node, "reg", -1);
|
vop_id = fdtdec_get_int(blob, ep_node, "reg", -1);
|
||||||
debug("vop_id=%d\n", vop_id);
|
debug("vop_id=%d\n", vop_id);
|
||||||
@ -253,6 +252,19 @@ int rk_display_init(struct udevice *dev, ulong fbbase,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set bitwidth for vop display according to vop mode */
|
||||||
|
switch (vop_id) {
|
||||||
|
case VOP_MODE_EDP:
|
||||||
|
case VOP_MODE_HDMI:
|
||||||
|
case VOP_MODE_LVDS:
|
||||||
|
l2bpp = VIDEO_BPP16;
|
||||||
|
break;
|
||||||
|
case VOP_MODE_MIPI:
|
||||||
|
l2bpp = VIDEO_BPP32;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
l2bpp = VIDEO_BPP16;
|
||||||
|
}
|
||||||
rkvop_mode_set(regs, &timing, vop_id);
|
rkvop_mode_set(regs, &timing, vop_id);
|
||||||
|
|
||||||
rkvop_enable(regs, fbbase, 1 << l2bpp, &timing);
|
rkvop_enable(regs, fbbase, 1 << l2bpp, &timing);
|
||||||
@ -330,7 +342,7 @@ static int rk_vop_probe(struct udevice *dev)
|
|||||||
for (node = fdt_first_subnode(blob, port);
|
for (node = fdt_first_subnode(blob, port);
|
||||||
node > 0;
|
node > 0;
|
||||||
node = fdt_next_subnode(blob, node)) {
|
node = fdt_next_subnode(blob, node)) {
|
||||||
ret = rk_display_init(dev, plat->base, VIDEO_BPP16, node);
|
ret = rk_display_init(dev, plat->base, node);
|
||||||
if (ret)
|
if (ret)
|
||||||
debug("Device failed: ret=%d\n", ret);
|
debug("Device failed: ret=%d\n", ret);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user