From: addy ke Date: Mon, 8 Sep 2014 03:38:25 +0000 (+0800) Subject: i2c: rk3x: fix divisor calculation for SCL frequency X-Git-Tag: fixes-for-v3.18-merge-window~67^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4a7bd7a386dc6b0bb49cb47614e06e8295d495a;p=pandora-kernel.git i2c: rk3x: fix divisor calculation for SCL frequency I2C_CLKDIV register descripted in the previous version of RK3x chip manual is incorrect. Plus 1 is required. The correct formula: - T(SCL_HIGH) = T(PCLK) * (CLKDIVH + 1) * 8 - T(SCL_LOW) = T(PCLK) * (CLKDIVL + 1) * 8 - (SCL Divsor) = 8 * ((CLKDIVL + 1) + (CLKDIVH + 1)) - SCL = PCLK / (CLK Divsor) It will be updated to the latest version of chip manual. Signed-off-by: Addy Ke Reviewed-by: Doug Anderson Signed-off-by: Wolfram Sang Cc: stable@kernel.org --- Reading git-diff-tree failed