[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57331B3A.7050801@gmail.com>
Date: Wed, 11 May 2016 19:44:58 +0800
From: Caesar Wang <caesar.upstream@...il.com>
To: David Wu <david.wu@...k-chips.com>
Cc: heiko@...ech.de, wsa@...-dreams.de, mark.rutland@....com,
huangtao@...k-chips.com, xjq@...k-chips.com, hl@...k-chips.com,
pawel.moll@....com, ijc+devicetree@...lion.org.uk,
devicetree@...r.kernel.org, linux-rockchip@...ts.infradead.org,
dianders@...omium.org, linux-kernel@...r.kernel.org,
cf@...k-chips.com, andy.shevchenko@...il.com, robh+dt@...nel.org,
linux-i2c@...r.kernel.org, galak@...eaurora.org,
zyw@...k-chips.com, briannorris@...gle.com, davidriley@...gle.com,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v8 8/8] i2c: rk3x: support fast-mode plus for rk3399
在 2016年05月11日 03:33, David Wu 写道:
> Signed-off-by: David Wu <david.wu@...k-chips.com>
> Reviewed-by: Douglas Anderson <dianders@...omium.org>
Tested-by: Caesar Wang <wxt@...k-chips.com>
> ---
> Change in v8:
> - None
>
> drivers/i2c/busses/i2c-rk3x.c | 21 +++++++++++++++++----
> 1 file changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
> index 25ed1ad..0ba25ee 100644
> --- a/drivers/i2c/busses/i2c-rk3x.c
> +++ b/drivers/i2c/busses/i2c-rk3x.c
> @@ -126,6 +126,17 @@ static const struct i2c_spec_values fast_mode_spec = {
> .min_hold_buffer_ns = 1300,
> };
>
> +static const struct i2c_spec_values fast_mode_plus_spec = {
> + .min_hold_start_ns = 260,
> + .min_low_ns = 500,
> + .min_high_ns = 260,
> + .min_setup_start_ns = 260,
> + .max_data_hold_ns = 400,
> + .min_data_setup_ns = 50,
> + .min_setup_stop_ns = 260,
> + .min_hold_buffer_ns = 500,
> +};
> +
> /**
> * struct rk3x_i2c_calced_timings:
> * @div_low: Divider output for low
> @@ -531,8 +542,10 @@ static const struct i2c_spec_values *rk3x_i2c_get_spec(unsigned int speed)
> {
> if (speed <= 100000)
> return &standard_mode_spec;
> - else
> + else if (speed <= 400000)
> return &fast_mode_spec;
> + else
> + return &fast_mode_plus_spec;
> }
>
> /**
> @@ -743,9 +756,9 @@ static int rk3x_i2c_v1_calc_timings(unsigned long clk_rate,
> const struct i2c_spec_values *spec;
> int ret = 0;
>
> - /* Support standard-mode and fast-mode */
> - if (WARN_ON(t->bus_freq_hz > 400000))
> - t->bus_freq_hz = 400000;
> + /* Support standard-mode, fast-mode and fast-mode plus */
> + if (WARN_ON(t->bus_freq_hz > 1000000))
> + t->bus_freq_hz = 1000000;
>
> /* prevent scl_rate_khz from becoming 0 */
> if (WARN_ON(t->bus_freq_hz < 1000))
--
Thanks,
Caesar
Powered by blists - more mailing lists