Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1398683
| From | David Wu <david.wu@rock-chips.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v8 8/8] i2c: rk3x: support fast-mode plus for rk3399 |
| Date | 2016-05-11 06:20 +0200 |
| Message-ID | <rxtMS-Fp-7@gated-at.bofh.it> (permalink) |
| References | <rxtDc-wb-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Signed-off-by: David Wu <david.wu@rock-chips.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
---
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))
--
1.9.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v8 0/8] add i2c driver supported for rk3399 David Wu <david.wu@rock-chips.com> - 2016-05-11 06:10 +0200
[PATCH v8 2/8] i2c: rk3x: use struct "rk3x_i2c_calced_timings" David Wu <david.wu@rock-chips.com> - 2016-05-11 06:10 +0200
[PATCH v8 1/8] i2c: rk3x: add documentation to fields in "struct rk3x_i2c" David Wu <david.wu@rock-chips.com> - 2016-05-11 06:10 +0200
Re: [PATCH v8 1/8] i2c: rk3x: add documentation to fields in "struct rk3x_i2c" Heiko Stuebner <heiko@sntech.de> - 2016-05-11 17:10 +0200
[PATCH v8 3/8] i2c: rk3x: Remove redundant rk3x_i2c_clean_ipd() David Wu <david.wu@rock-chips.com> - 2016-05-11 06:10 +0200
Re: [PATCH v8 3/8] i2c: rk3x: Remove redundant rk3x_i2c_clean_ipd() Heiko Stuebner <heiko@sntech.de> - 2016-05-11 20:30 +0200
Re: [PATCH v8 3/8] i2c: rk3x: Remove redundant rk3x_i2c_clean_ipd() "David.Wu" <david.wu@rock-chips.com> - 2016-05-12 03:20 +0200
[PATCH v8 4/8] i2c: rk3x: Change SoC data to not use array David Wu <david.wu@rock-chips.com> - 2016-05-11 06:10 +0200
[PATCH v8 5/8] i2c: rk3x: Move spec timing data to "static const" structs David Wu <david.wu@rock-chips.com> - 2016-05-11 06:10 +0200
[PATCH v8 8/8] i2c: rk3x: support fast-mode plus for rk3399 David Wu <david.wu@rock-chips.com> - 2016-05-11 06:20 +0200
Re: [PATCH v8 8/8] i2c: rk3x: support fast-mode plus for rk3399 Caesar Wang <caesar.upstream@gmail.com> - 2016-05-11 13:50 +0200
Re: [PATCH v8 8/8] i2c: rk3x: support fast-mode plus for rk3399 Heiko Stuebner <heiko@sntech.de> - 2016-05-11 23:20 +0200
Re: [PATCH v8 8/8] i2c: rk3x: support fast-mode plus for rk3399 Doug Anderson <dianders@chromium.org> - 2016-05-12 01:50 +0200
Re: [PATCH v8 8/8] i2c: rk3x: support fast-mode plus for rk3399 Heiko Stuebner <heiko@sntech.de> - 2016-05-12 10:40 +0200
csiph-web