linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: heiko@sntech.de (Heiko Stübner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 2/2] i2c: rk3x: add i2c support for rk3399 soc
Date: Fri, 15 Apr 2016 14:17:58 +0200	[thread overview]
Message-ID: <4971788.LeT208jGID@diego> (raw)
In-Reply-To: <1458147438-62387-3-git-send-email-david.wu@rock-chips.com>

Hi David,

Am Donnerstag, 17. M?rz 2016, 00:57:18 schrieb David Wu:
> From: David Wu <wdc@rock-chips.com>
> 
> - new method to caculate i2c timings for rk3399:
>   There was an timing issue about "repeated start" time at the I2C
>   controller of version0, controller appears to drop SDA at .875x (7/8)
>   programmed clk high. On version 1 of the controller, the rule(.875x)
>   isn't enough to meet tSU;STA
>   requirements on 100k's Standard-mode. To resolve this issue,
>   sda_update_config, start_setup_config and stop_setup_config for I2C
>   timing information are added, new rules are designed to calculate
>   the timing information at new v1.
> - pclk and function clk are separated at rk3399.
> - support i2c highspeed mode: 1.7MHz for rk3399
> 
> Signed-off-by: David Wu <david.wu@rock-chips.com>

[...]

> @@ -83,11 +88,34 @@ enum rk3x_i2c_state {
>  	STATE_STOP
>  };
> 
> +struct rk3x_i2c;
> +
> +/**
> + * struct rk3x_i2c_calced_timings:
> + * @div_low: Divider output for low
> + * @div_high: Divider output for high
> + * @sda_update_cfg: Used to config sda change state when scl is low,
> + * used to adjust setup/hold time
> + * @stp_sta_cfg: Start setup config for setup start time and hold start
> time + * @stp_sto_cfg: Stop setup config for setup stop time
> + */
> +struct rk3x_i2c_calced_timings {
> +	unsigned long div_low;
> +	unsigned long div_high;
> +	unsigned int sda_update_cfg;
> +	unsigned int stp_sta_cfg;
> +	unsigned int stp_sto_cfg;
> +};
> +
>  /**
>   * @grf_offset: offset inside the grf regmap for setting the i2c type
>   */
>  struct rk3x_i2c_soc_data {
>  	int grf_offset;
> +
> +	int (*clk_init)(struct rk3x_i2c *, unsigned long *);
> +	int (*calc_timings)(unsigned long, struct i2c_timings *,
> +			    struct rk3x_i2c_calced_timings *);
>  };
> 
>  struct rk3x_i2c {
> @@ -97,11 +125,13 @@ struct rk3x_i2c {
> 
>  	/* Hardware resources */
>  	void __iomem *regs;
> -	struct clk *clk;
> +	struct clk *pclk; /* APB clock */
> +	struct clk *clk; /* Func clk for rk3399 or Func & APB clks for others */
>  	struct notifier_block clk_rate_nb;

please use regular kernel-doc for the struct elements (aka @pclk: something) 
like some of the other fields already have.

I can't spot anything else, but also don't know enough about i2c itself :-)


Heiko

  parent reply	other threads:[~2016-04-15 12:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 16:57 [PATCH v5 0/2] updates for rk3399 i2c support David Wu
2016-03-16 16:57 ` [PATCH v5 1/2] i2c: rk3x: switch to i2c generic dt parsing David Wu
2016-04-14 18:39   ` Wolfram Sang
2016-03-16 16:57 ` [PATCH v5 2/2] i2c: rk3x: add i2c support for rk3399 soc David Wu
2016-04-14 18:48   ` Wolfram Sang
2016-04-15  7:31     ` Heiko Stübner
2016-04-15 12:12       ` David.Wu
2016-04-15 12:10     ` David.Wu
2016-04-15 17:58       ` Wolfram Sang
2016-04-18 13:15         ` David.Wu
2016-04-15 12:17   ` Heiko Stübner [this message]
2016-04-19 13:55   ` [PATCH v6] " David Wu
2016-04-21 22:00     ` Andy Shevchenko
2016-04-27 20:56     ` Doug Anderson
     [not found]       ` <572212AE.5060904@rock-chips.com>
2016-04-28 21:28         ` Doug Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4971788.LeT208jGID@diego \
    --to=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).