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:
"Some easy but needed fixes for i2c drivers since rc1"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: bcm2835: Linking platform nodes to adapter nodes
i2c: omap: raw read and write endian fix
i2c: i2c-bcm-kona: Fix module build
i2c: i2c-diolan-u2c: different usb endpoints for DLN-2-U2C
i2c: bcm-kona: remove duplicated include
i2c: davinci: raw read and write endian fix

+19 -13
+1 -2
drivers/i2c/busses/i2c-bcm-kona.c
··· 20 20 #include <linux/platform_device.h> 21 21 #include <linux/clk.h> 22 22 #include <linux/io.h> 23 - #include <linux/clk.h> 24 23 #include <linux/slab.h> 25 24 26 25 /* Hardware register offsets and field defintions */ ··· 890 891 {.compatible = "brcm,kona-i2c",}, 891 892 {}, 892 893 }; 893 - MODULE_DEVICE_TABLE(of, kona_i2c_of_match); 894 + MODULE_DEVICE_TABLE(of, bcm_kona_i2c_of_match); 894 895 895 896 static struct platform_driver bcm_kona_i2c_driver = { 896 897 .driver = {
+1
drivers/i2c/busses/i2c-bcm2835.c
··· 299 299 strlcpy(adap->name, "bcm2835 I2C adapter", sizeof(adap->name)); 300 300 adap->algo = &bcm2835_i2c_algo; 301 301 adap->dev.parent = &pdev->dev; 302 + adap->dev.of_node = pdev->dev.of_node; 302 303 303 304 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, 0); 304 305
+2 -2
drivers/i2c/busses/i2c-davinci.c
··· 125 125 static inline void davinci_i2c_write_reg(struct davinci_i2c_dev *i2c_dev, 126 126 int reg, u16 val) 127 127 { 128 - __raw_writew(val, i2c_dev->base + reg); 128 + writew_relaxed(val, i2c_dev->base + reg); 129 129 } 130 130 131 131 static inline u16 davinci_i2c_read_reg(struct davinci_i2c_dev *i2c_dev, int reg) 132 132 { 133 - return __raw_readw(i2c_dev->base + reg); 133 + return readw_relaxed(i2c_dev->base + reg); 134 134 } 135 135 136 136 /* Generate a pulse on the i2c clock pin. */
+11 -5
drivers/i2c/busses/i2c-diolan-u2c.c
··· 25 25 #define USB_VENDOR_ID_DIOLAN 0x0abf 26 26 #define USB_DEVICE_ID_DIOLAN_U2C 0x3370 27 27 28 - #define DIOLAN_OUT_EP 0x02 29 - #define DIOLAN_IN_EP 0x84 30 28 31 29 /* commands via USB, must match command ids in the firmware */ 32 30 #define CMD_I2C_READ 0x01 ··· 82 84 struct i2c_diolan_u2c { 83 85 u8 obuffer[DIOLAN_OUTBUF_LEN]; /* output buffer */ 84 86 u8 ibuffer[DIOLAN_INBUF_LEN]; /* input buffer */ 87 + int ep_in, ep_out; /* Endpoints */ 85 88 struct usb_device *usb_dev; /* the usb device for this device */ 86 89 struct usb_interface *interface;/* the interface for this device */ 87 90 struct i2c_adapter adapter; /* i2c related things */ ··· 108 109 return -EINVAL; 109 110 110 111 ret = usb_bulk_msg(dev->usb_dev, 111 - usb_sndbulkpipe(dev->usb_dev, DIOLAN_OUT_EP), 112 + usb_sndbulkpipe(dev->usb_dev, dev->ep_out), 112 113 dev->obuffer, dev->olen, &actual, 113 114 DIOLAN_USB_TIMEOUT); 114 115 if (!ret) { ··· 117 118 118 119 tmpret = usb_bulk_msg(dev->usb_dev, 119 120 usb_rcvbulkpipe(dev->usb_dev, 120 - DIOLAN_IN_EP), 121 + dev->ep_in), 121 122 dev->ibuffer, 122 123 sizeof(dev->ibuffer), &actual, 123 124 DIOLAN_USB_TIMEOUT); ··· 209 210 int ret; 210 211 211 212 ret = usb_bulk_msg(dev->usb_dev, 212 - usb_rcvbulkpipe(dev->usb_dev, DIOLAN_IN_EP), 213 + usb_rcvbulkpipe(dev->usb_dev, dev->ep_in), 213 214 dev->ibuffer, sizeof(dev->ibuffer), &actual, 214 215 DIOLAN_USB_TIMEOUT); 215 216 if (ret < 0 || actual == 0) ··· 444 445 static int diolan_u2c_probe(struct usb_interface *interface, 445 446 const struct usb_device_id *id) 446 447 { 448 + struct usb_host_interface *hostif = interface->cur_altsetting; 447 449 struct i2c_diolan_u2c *dev; 448 450 int ret; 451 + 452 + if (hostif->desc.bInterfaceNumber != 0 453 + || hostif->desc.bNumEndpoints < 2) 454 + return -ENODEV; 449 455 450 456 /* allocate memory for our device state and initialize it */ 451 457 dev = kzalloc(sizeof(*dev), GFP_KERNEL); ··· 459 455 ret = -ENOMEM; 460 456 goto error; 461 457 } 458 + dev->ep_out = hostif->endpoint[0].desc.bEndpointAddress; 459 + dev->ep_in = hostif->endpoint[1].desc.bEndpointAddress; 462 460 463 461 dev->usb_dev = usb_get_dev(interface_to_usbdev(interface)); 464 462 dev->interface = interface;
+4 -4
drivers/i2c/busses/i2c-omap.c
··· 266 266 static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev, 267 267 int reg, u16 val) 268 268 { 269 - __raw_writew(val, i2c_dev->base + 269 + writew_relaxed(val, i2c_dev->base + 270 270 (i2c_dev->regs[reg] << i2c_dev->reg_shift)); 271 271 } 272 272 273 273 static inline u16 omap_i2c_read_reg(struct omap_i2c_dev *i2c_dev, int reg) 274 274 { 275 - return __raw_readw(i2c_dev->base + 275 + return readw_relaxed(i2c_dev->base + 276 276 (i2c_dev->regs[reg] << i2c_dev->reg_shift)); 277 277 } 278 278 ··· 1162 1162 * Read the Rev hi bit-[15:14] ie scheme this is 1 indicates ver2. 1163 1163 * On omap1/3/2 Offset 4 is IE Reg the bit [15:14] is 0 at reset. 1164 1164 * Also since the omap_i2c_read_reg uses reg_map_ip_* a 1165 - * raw_readw is done. 1165 + * readw_relaxed is done. 1166 1166 */ 1167 - rev = __raw_readw(dev->base + 0x04); 1167 + rev = readw_relaxed(dev->base + 0x04); 1168 1168 1169 1169 dev->scheme = OMAP_I2C_SCHEME(rev); 1170 1170 switch (dev->scheme) {