Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
"i2c driver bugfixes (s3c2410, slave-eeprom, sh_mobile), size
regression "bugfix" (i2c slave), documentation bugfix (st).

Also, one documentation update (da9063), so some devicetrees can now
be verified"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: sh_mobile: terminate DMA reads properly
i2c: Only include slave support if selected
i2c: s3c2410: fix ABBA deadlock by keeping clock prepared
i2c: slave-eeprom: fix boundary check when using sysfs
i2c: st: Rename clock reference to something that exists
DT: i2c: Add devices handled by the da9063 MFD driver

+41 -10
+1 -1
Documentation/devicetree/bindings/i2c/i2c-st.txt
··· 31 31 compatible = "st,comms-ssc4-i2c"; 32 32 reg = <0xfed40000 0x110>; 33 33 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>; 34 - clocks = <&CLK_S_ICN_REG_0>; 34 + clocks = <&clk_s_a0_ls CLK_ICN_REG>; 35 35 clock-names = "ssc"; 36 36 clock-frequency = <400000>; 37 37 pinctrl-names = "default";
+1
Documentation/devicetree/bindings/i2c/trivial-devices.txt
··· 47 47 dallas,ds4510 CPU Supervisor with Nonvolatile Memory and Programmable I/O 48 48 dallas,ds75 Digital Thermometer and Thermostat 49 49 dlg,da9053 DA9053: flexible system level PMIC with multicore support 50 + dlg,da9063 DA9063: system PMIC for quad-core application processors 50 51 epson,rx8025 High-Stability. I2C-Bus INTERFACE REAL TIME CLOCK MODULE 51 52 epson,rx8581 I2C-BUS INTERFACE REAL TIME CLOCK MODULE 52 53 fsl,mag3110 MAG3110: Xtrinsic High Accuracy, 3D Magnetometer
+1
drivers/i2c/busses/Kconfig
··· 881 881 config I2C_RCAR 882 882 tristate "Renesas R-Car I2C Controller" 883 883 depends on ARCH_SHMOBILE || COMPILE_TEST 884 + select I2C_SLAVE 884 885 help 885 886 If you say yes to this option, support will be included for the 886 887 R-Car I2C controller.
+17 -6
drivers/i2c/busses/i2c-s3c2410.c
··· 785 785 int ret; 786 786 787 787 pm_runtime_get_sync(&adap->dev); 788 - clk_prepare_enable(i2c->clk); 788 + ret = clk_enable(i2c->clk); 789 + if (ret) 790 + return ret; 789 791 790 792 for (retry = 0; retry < adap->retries; retry++) { 791 793 792 794 ret = s3c24xx_i2c_doxfer(i2c, msgs, num); 793 795 794 796 if (ret != -EAGAIN) { 795 - clk_disable_unprepare(i2c->clk); 797 + clk_disable(i2c->clk); 796 798 pm_runtime_put(&adap->dev); 797 799 return ret; 798 800 } ··· 804 802 udelay(100); 805 803 } 806 804 807 - clk_disable_unprepare(i2c->clk); 805 + clk_disable(i2c->clk); 808 806 pm_runtime_put(&adap->dev); 809 807 return -EREMOTEIO; 810 808 } ··· 1199 1197 1200 1198 clk_prepare_enable(i2c->clk); 1201 1199 ret = s3c24xx_i2c_init(i2c); 1202 - clk_disable_unprepare(i2c->clk); 1200 + clk_disable(i2c->clk); 1203 1201 if (ret != 0) { 1204 1202 dev_err(&pdev->dev, "I2C controller init failed\n"); 1205 1203 return ret; ··· 1212 1210 i2c->irq = ret = platform_get_irq(pdev, 0); 1213 1211 if (ret <= 0) { 1214 1212 dev_err(&pdev->dev, "cannot find IRQ\n"); 1213 + clk_unprepare(i2c->clk); 1215 1214 return ret; 1216 1215 } 1217 1216 ··· 1221 1218 1222 1219 if (ret != 0) { 1223 1220 dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq); 1221 + clk_unprepare(i2c->clk); 1224 1222 return ret; 1225 1223 } 1226 1224 } ··· 1229 1225 ret = s3c24xx_i2c_register_cpufreq(i2c); 1230 1226 if (ret < 0) { 1231 1227 dev_err(&pdev->dev, "failed to register cpufreq notifier\n"); 1228 + clk_unprepare(i2c->clk); 1232 1229 return ret; 1233 1230 } 1234 1231 ··· 1246 1241 if (ret < 0) { 1247 1242 dev_err(&pdev->dev, "failed to add bus to i2c core\n"); 1248 1243 s3c24xx_i2c_deregister_cpufreq(i2c); 1244 + clk_unprepare(i2c->clk); 1249 1245 return ret; 1250 1246 } 1251 1247 ··· 1267 1261 static int s3c24xx_i2c_remove(struct platform_device *pdev) 1268 1262 { 1269 1263 struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); 1264 + 1265 + clk_unprepare(i2c->clk); 1270 1266 1271 1267 pm_runtime_disable(&i2c->adap.dev); 1272 1268 pm_runtime_disable(&pdev->dev); ··· 1301 1293 { 1302 1294 struct platform_device *pdev = to_platform_device(dev); 1303 1295 struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); 1296 + int ret; 1304 1297 1305 1298 if (!IS_ERR(i2c->sysreg)) 1306 1299 regmap_write(i2c->sysreg, EXYNOS5_SYS_I2C_CFG, i2c->sys_i2c_cfg); 1307 1300 1308 - clk_prepare_enable(i2c->clk); 1301 + ret = clk_enable(i2c->clk); 1302 + if (ret) 1303 + return ret; 1309 1304 s3c24xx_i2c_init(i2c); 1310 - clk_disable_unprepare(i2c->clk); 1305 + clk_disable(i2c->clk); 1311 1306 i2c->suspended = 0; 1312 1307 1313 1308 return 0;
+11 -1
drivers/i2c/busses/i2c-sh_mobile.c
··· 139 139 int pos; 140 140 int sr; 141 141 bool send_stop; 142 + bool stop_after_dma; 142 143 143 144 struct resource *res; 144 145 struct dma_chan *dma_tx; ··· 408 407 409 408 if (pd->pos == pd->msg->len) { 410 409 /* Send stop if we haven't yet (DMA case) */ 411 - if (pd->send_stop && (iic_rd(pd, ICCR) & ICCR_BBSY)) 410 + if (pd->send_stop && pd->stop_after_dma) 412 411 i2c_op(pd, OP_TX_STOP, 0); 413 412 return 1; 414 413 } ··· 450 449 real_pos = pd->pos - 2; 451 450 452 451 if (pd->pos == pd->msg->len) { 452 + if (pd->stop_after_dma) { 453 + /* Simulate PIO end condition after DMA transfer */ 454 + i2c_op(pd, OP_RX_STOP, 0); 455 + pd->pos++; 456 + break; 457 + } 458 + 453 459 if (real_pos < 0) { 454 460 i2c_op(pd, OP_RX_STOP, 0); 455 461 break; ··· 544 536 545 537 sh_mobile_i2c_dma_unmap(pd); 546 538 pd->pos = pd->msg->len; 539 + pd->stop_after_dma = true; 547 540 548 541 iic_set_clr(pd, ICIC, 0, ICIC_TDMAE | ICIC_RDMAE); 549 542 } ··· 735 726 bool do_start = pd->send_stop || !i; 736 727 msg = &msgs[i]; 737 728 pd->send_stop = i == num - 1 || msg->flags & I2C_M_STOP; 729 + pd->stop_after_dma = false; 738 730 739 731 err = start_ch(pd, msg, do_start); 740 732 if (err)
+2
drivers/i2c/i2c-core.c
··· 2972 2972 } 2973 2973 EXPORT_SYMBOL(i2c_smbus_xfer); 2974 2974 2975 + #if IS_ENABLED(CONFIG_I2C_SLAVE) 2975 2976 int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb) 2976 2977 { 2977 2978 int ret; ··· 3020 3019 return ret; 3021 3020 } 3022 3021 EXPORT_SYMBOL_GPL(i2c_slave_unregister); 3022 + #endif 3023 3023 3024 3024 MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>"); 3025 3025 MODULE_DESCRIPTION("I2C-Bus main module");
+2 -2
drivers/i2c/i2c-slave-eeprom.c
··· 74 74 struct eeprom_data *eeprom; 75 75 unsigned long flags; 76 76 77 - if (off + count >= attr->size) 77 + if (off + count > attr->size) 78 78 return -EFBIG; 79 79 80 80 eeprom = dev_get_drvdata(container_of(kobj, struct device, kobj)); ··· 92 92 struct eeprom_data *eeprom; 93 93 unsigned long flags; 94 94 95 - if (off + count >= attr->size) 95 + if (off + count > attr->size) 96 96 return -EFBIG; 97 97 98 98 eeprom = dev_get_drvdata(container_of(kobj, struct device, kobj));
+6
include/linux/i2c.h
··· 228 228 struct device dev; /* the device structure */ 229 229 int irq; /* irq issued by device */ 230 230 struct list_head detected; 231 + #if IS_ENABLED(CONFIG_I2C_SLAVE) 231 232 i2c_slave_cb_t slave_cb; /* callback for slave mode */ 233 + #endif 232 234 }; 233 235 #define to_i2c_client(d) container_of(d, struct i2c_client, dev) 234 236 ··· 255 253 256 254 /* I2C slave support */ 257 255 256 + #if IS_ENABLED(CONFIG_I2C_SLAVE) 258 257 enum i2c_slave_event { 259 258 I2C_SLAVE_REQ_READ_START, 260 259 I2C_SLAVE_REQ_READ_END, ··· 272 269 { 273 270 return client->slave_cb(client, event, val); 274 271 } 272 + #endif 275 273 276 274 /** 277 275 * struct i2c_board_info - template for device creation ··· 408 404 /* To determine what the adapter supports */ 409 405 u32 (*functionality) (struct i2c_adapter *); 410 406 407 + #if IS_ENABLED(CONFIG_I2C_SLAVE) 411 408 int (*reg_slave)(struct i2c_client *client); 412 409 int (*unreg_slave)(struct i2c_client *client); 410 + #endif 413 411 }; 414 412 415 413 /**