i2c: designware: Rename accessor_flags to flags
authorHans de Goede <hdegoede@redhat.com>
Fri, 10 Feb 2017 10:27:53 +0000 (11:27 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 2 Mar 2017 14:46:31 +0000 (15:46 +0100)
Rename accessor_flags to flags, so that we can use the field for
other flags too. This is a preparation patch for adding cherrytrail
support to the punit semaphore code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170210102802.20898-4-hdegoede@redhat.com
drivers/i2c/busses/i2c-designware-core.c
drivers/i2c/busses/i2c-designware-core.h
drivers/i2c/busses/i2c-designware-platdrv.c

index 6d81c56..8c3ba42 100644 (file)
@@ -177,13 +177,13 @@ static u32 dw_readl(struct dw_i2c_dev *dev, int offset)
 {
        u32 value;
 
-       if (dev->accessor_flags & ACCESS_16BIT)
+       if (dev->flags & ACCESS_16BIT)
                value = readw_relaxed(dev->base + offset) |
                        (readw_relaxed(dev->base + offset + 2) << 16);
        else
                value = readl_relaxed(dev->base + offset);
 
-       if (dev->accessor_flags & ACCESS_SWAP)
+       if (dev->flags & ACCESS_SWAP)
                return swab32(value);
        else
                return value;
@@ -191,10 +191,10 @@ static u32 dw_readl(struct dw_i2c_dev *dev, int offset)
 
 static void dw_writel(struct dw_i2c_dev *dev, u32 b, int offset)
 {
-       if (dev->accessor_flags & ACCESS_SWAP)
+       if (dev->flags & ACCESS_SWAP)
                b = swab32(b);
 
-       if (dev->accessor_flags & ACCESS_16BIT) {
+       if (dev->flags & ACCESS_16BIT) {
                writew_relaxed((u16)b, dev->base + offset);
                writew_relaxed((u16)(b >> 16), dev->base + offset + 2);
        } else {
@@ -339,10 +339,10 @@ int i2c_dw_init(struct dw_i2c_dev *dev)
        reg = dw_readl(dev, DW_IC_COMP_TYPE);
        if (reg == ___constant_swab32(DW_IC_COMP_TYPE_VALUE)) {
                /* Configure register endianess access */
-               dev->accessor_flags |= ACCESS_SWAP;
+               dev->flags |= ACCESS_SWAP;
        } else if (reg == (DW_IC_COMP_TYPE_VALUE & 0x0000ffff)) {
                /* Configure register access mode 16bit */
-               dev->accessor_flags |= ACCESS_16BIT;
+               dev->flags |= ACCESS_16BIT;
        } else if (reg != DW_IC_COMP_TYPE_VALUE) {
                dev_err(dev->dev, "Unknown Synopsys component type: "
                        "0x%08x\n", reg);
@@ -926,7 +926,7 @@ static irqreturn_t i2c_dw_isr(int this_irq, void *dev_id)
 tx_aborted:
        if ((stat & (DW_IC_INTR_TX_ABRT | DW_IC_INTR_STOP_DET)) || dev->msg_err)
                complete(&dev->cmd_complete);
-       else if (unlikely(dev->accessor_flags & ACCESS_INTR_MASK)) {
+       else if (unlikely(dev->flags & ACCESS_INTR_MASK)) {
                /* workaround to trigger pending interrupt */
                stat = dw_readl(dev, DW_IC_INTR_MASK);
                i2c_dw_disable_int(dev);
index 26250b4..2c50571 100644 (file)
@@ -103,7 +103,7 @@ struct dw_i2c_dev {
        unsigned int            status;
        u32                     abort_source;
        int                     irq;
-       u32                     accessor_flags;
+       u32                     flags;
        struct i2c_adapter      adapter;
        u32                     functionality;
        u32                     master_cfg;
index 6ce4313..3eede7b 100644 (file)
@@ -112,7 +112,7 @@ static int dw_i2c_acpi_configure(struct platform_device *pdev)
 
        id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
        if (id && id->driver_data)
-               dev->accessor_flags |= (u32)id->driver_data;
+               dev->flags |= (u32)id->driver_data;
 
        return 0;
 }