Skip to content

Commit dde9a38

Browse files
claudiubezneaWolfram Sang
authored andcommitted
i2c: riic: Allow setting frequencies lower than 50KHz
The MR1.CKS field is 3 bits wide and all the possible values (from 0 to 7) are valid. This is true for all the SoCs currently integrated in upstream Linux. Take into account CKS=7 which allows setting bus frequencies lower than 50KHz. This may be useful at least for debugging. Fixes: d982d66 ("i2c: riic: remove clock and frequency restrictions") Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 2f6aa0a commit dde9a38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-riic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ static int riic_init_hw(struct riic_dev *riic)
386386
*/
387387
total_ticks = DIV_ROUND_UP(rate, t->bus_freq_hz ?: 1);
388388

389-
for (cks = 0; cks < 7; cks++) {
389+
for (cks = 0; cks <= 7; cks++) {
390390
/*
391391
* 60% low time must be less than BRL + 2 + 1
392392
* BRL max register value is 0x1F.

0 commit comments

Comments
 (0)