[2/9] phy: add Rockchip Innosilicon hdmi phy

Martin Cerveny martin at c-home.cz
Mon Feb 5 13:32:08 PST 2018


Hello.

On Mon, 5 Feb 2018, Heiko Stuebner wrote:
> From: Zheng Yang <zhengyang at rock-chips.com>
>
> Add a driver for the Innosilicon hdmi phy used on rk3228/rk3229
> and rk3328 socs from Rockchip.
>
> Signed-off-by: Zheng Yang <zhengyang at rock-chips.com>
> Signed-off-by: Heiko Stuebner <heiko at sntech.de>
> ---
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
> +static u32 inno_hdmi_phy_get_tmdsclk(struct inno_hdmi_phy *inno, int rate)
> +{
> +	int bus_width = phy_get_bus_width(inno->phy);
> +	u32 tmdsclk;
> +
> +	switch (bus_width) {
> +	case 4:
> +		tmdsclk = rate / 2;
> +		break;
> +	case 5:
> +		tmdsclk = rate * 5 / 8;
> +		break;
> +	case 6:
> +		tmdsclk = rate * 3 / 4;
> +		break;
> +	case 10:
> +		tmdsclk = rate * 5 / 4;
> +		break;
> +	case 12:
> +		tmdsclk = rate * 3 / 2;
> +		break;
> +	case 16:
> +		tmdsclk = rate * 2;
> +		break;
> +	default:
> +		tmdsclk = rate;
> +	}
> +
> +	return tmdsclk;
> +}

Please corrects integer overflow 
like https://github.com/mcerveny/rockchip-linux/commit/b4bc703f2dca4e5115b22155920d2277671a9f00

M.C>



More information about the linux-arm-kernel mailing list