lkml.org 
[lkml]   [2021]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] i2c: designware: Switch over to i2c_freq_mode_string()
On Wed, Mar 31, 2021 at 08:53:02AM +0000, Song Bao Hua (Barry Song) wrote:
>
> > No, please read the code carefully.
> > We can duplicate conditional, but it brings a bit of inconsistency to how the counters are printed.
>
> Thanks for clarification, I am still confused as the original
> code print the real mode based on dev->master_cfg, the new
> code is printing mode based on frequency.
>
> My understanding is the original code could fall back to a lower
> speed when higher speed modes were not set successfully. For
> example, high speed mode falls back to fast mode:

This is a good catch! I should be fixed by a separate patch I assume.

> if ((dev->master_cfg & DW_IC_CON_SPEED_MASK) ==
> DW_IC_CON_SPEED_HIGH) {
> if ((comp_param1 & DW_IC_COMP_PARAM_1_SPEED_MODE_MASK)
> != DW_IC_COMP_PARAM_1_SPEED_MODE_HIGH) {
> dev_err(dev->dev, "High Speed not supported!\n");
> dev->master_cfg &= ~DW_IC_CON_SPEED_MASK;
> dev->master_cfg |= DW_IC_CON_SPEED_FAST;

Basically we have to adjust timings here to reflect this change.

> dev->hs_hcnt = 0;
> dev->hs_lcnt = 0;
> }


--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2021-03-31 12:21    [W:0.045 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site