From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] i2c: cdns: Support different bus speeds
Date: Mon, 18 Apr 2016 13:09:25 +0200 [thread overview]
Message-ID: <5714C065.1070702@xilinx.com> (raw)
In-Reply-To: <5714880A.9060300@denx.de>
On 18.4.2016 09:08, Heiko Schocher wrote:
> Hello Michal,
>
> Am 14.04.2016 um 14:15 schrieb Michal Simek:
>> 400kHz is maximum freq which can be used on Xilinx ZynqMP.
>> Support it with standard divider calculator.
>> Input freq is hardcoded to 100MHz input freq till we have clock driver
>> which can provide this information for exact configuration.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>> drivers/i2c/i2c-cdns.c | 76
>> +++++++++++++++++++++++++++++++++++++++++++++-----
>> 1 file changed, 69 insertions(+), 7 deletions(-)
>
> just some nitpick, beside of this:
>
> Reviewed-by: Heiko Schocher <hs@denx.de>
>
>> diff --git a/drivers/i2c/i2c-cdns.c b/drivers/i2c/i2c-cdns.c
>> index 0bc6aaaa6f90..5642cd91fe2e 100644
>> --- a/drivers/i2c/i2c-cdns.c
>> +++ b/drivers/i2c/i2c-cdns.c
>> @@ -112,6 +112,7 @@ static void cdns_i2c_debug_status(struct
>> cdns_i2c_regs *cdns_i2c)
>>
>> struct i2c_cdns_bus {
>> int id;
>> + unsigned int input_freq;
>> struct cdns_i2c_regs __iomem *regs; /* register base */
>> };
>>
>> @@ -133,20 +134,79 @@ static u32 cdns_i2c_wait(struct cdns_i2c_regs
>> *cdns_i2c, u32 mask)
>> return int_status & mask;
>> }
>>
>> +#define CDNS_I2C_DIVA_MAX 4
>> +#define CDNS_I2C_DIVB_MAX 64
>> +
>> +static int cdns_i2c_calc_divs(unsigned long *f, unsigned long input_clk,
>> + unsigned int *a, unsigned int *b)
>> +{
>> + unsigned long fscl = *f, best_fscl = *f, actual_fscl, temp;
>> + unsigned int div_a, div_b, calc_div_a = 0, calc_div_b = 0;
>> + unsigned int last_error, current_error;
>> +
>> + /* calculate (divisor_a+1) x (divisor_b+1) */
>
> please add a space before and after the "+"
I have fixed this.
Thanks,
Michal
next prev parent reply other threads:[~2016-04-18 11:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 12:15 [U-Boot] [PATCH 1/4] i2c: cdns: Read address from DT in ofdata_to_platdata Michal Simek
2016-04-14 12:15 ` [U-Boot] [PATCH 2/4] i2c: cdns: Moving speed setup from probe to set_bus_speed function Michal Simek
2016-04-18 6:48 ` Heiko Schocher
2016-04-14 12:15 ` [U-Boot] [PATCH 3/4] i2c: cdns: Support different bus speeds Michal Simek
2016-04-18 7:08 ` Heiko Schocher
2016-04-18 11:09 ` Michal Simek [this message]
2016-04-14 12:15 ` [U-Boot] [PATCH 4/4] i2c: muxes: Add support for TI PCA954X mux Michal Simek
2016-04-18 7:27 ` Heiko Schocher
2016-04-20 14:41 ` Simon Glass
2016-04-25 8:36 ` Michal Simek
2016-04-18 6:47 ` [U-Boot] [PATCH 1/4] i2c: cdns: Read address from DT in ofdata_to_platdata Heiko Schocher
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=5714C065.1070702@xilinx.com \
--to=michal.simek@xilinx.com \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.