i2c-rk3x.c (d5d16892243e7755da706d03b34da85ea6a74117) | i2c-rk3x.c (cf27020d2f253bac6457d6833b97141030f0122a) |
---|---|
1/* 2 * Driver for I2C adapter in Rockchip RK3xxx SoC 3 * 4 * Max Schwarz <max.schwarz@online.de> 5 * based on the patches by Rockchip Inc. 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 224 unchanged lines hidden (view full) --- 233 unsigned int i, j; 234 u32 cnt = 0; 235 u32 val; 236 u8 byte; 237 238 for (i = 0; i < 8; ++i) { 239 val = 0; 240 for (j = 0; j < 4; ++j) { | 1/* 2 * Driver for I2C adapter in Rockchip RK3xxx SoC 3 * 4 * Max Schwarz <max.schwarz@online.de> 5 * based on the patches by Rockchip Inc. 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 224 unchanged lines hidden (view full) --- 233 unsigned int i, j; 234 u32 cnt = 0; 235 u32 val; 236 u8 byte; 237 238 for (i = 0; i < 8; ++i) { 239 val = 0; 240 for (j = 0; j < 4; ++j) { |
241 if (i2c->processed == i2c->msg->len) | 241 if ((i2c->processed == i2c->msg->len) && (cnt != 0)) |
242 break; 243 244 if (i2c->processed == 0 && cnt == 0) 245 byte = (i2c->addr & 0x7f) << 1; 246 else 247 byte = i2c->msg->buf[i2c->processed++]; 248 249 val |= byte << (j * 8); --- 517 unchanged lines hidden --- | 242 break; 243 244 if (i2c->processed == 0 && cnt == 0) 245 byte = (i2c->addr & 0x7f) << 1; 246 else 247 byte = i2c->msg->buf[i2c->processed++]; 248 249 val |= byte << (j * 8); --- 517 unchanged lines hidden --- |