Merge tag 'stmp-dev' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 May 2012 19:50:04 +0000 (12:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 May 2012 19:50:04 +0000 (12:50 -0700)
Pull arm-soc stmp-dev library code from Olof Johansson:
 "A number of devices are using a common register layout, this adds
  support code for it in lib/stmp_device.c so we do not need to
  duplicate it in each driver."

Fix up trivial conflicts in drivers/i2c/busses/i2c-mxs.c and
lib/Makefile

* tag 'stmp-dev' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  i2c: mxs: use global reset function
  lib: add support for stmp-style devices

1  2 
drivers/i2c/busses/Kconfig
drivers/i2c/busses/i2c-mxs.c
lib/Kconfig
lib/Makefile

index 94468a64ce3ac5c56ddf0a04bc8441ca2d9df0a3,ccfd37db3dfc0798b6e3fac200509bc551628033..eec2cf57539a8e31ca1df2c314cb4529b01e13ef
@@@ -351,7 -351,7 +351,7 @@@ config I2C_DAVINC
          For details please see http://www.ti.com/davinci
  
  config I2C_DESIGNWARE_PLATFORM
 -      tristate "Synopsys DesignWare Platfrom"
 +      tristate "Synopsys DesignWare Platform"
        depends on HAVE_CLK
        help
          If you say yes to this option, support will be included for the
@@@ -483,6 -483,7 +483,7 @@@ config I2C_MV64XX
  config I2C_MXS
        tristate "Freescale i.MX28 I2C interface"
        depends on SOC_IMX28
+       select STMP_DEVICE
        help
          Say Y here if you want to use the I2C bus controller on
          the Freescale i.MX28 processors.
index 7fa73eed84a7b695ed4fd45fda8b2cb9ee303182,083480241945f1ab78ede986adcd0a7d4f5b348c..58a338846f065daade5edadecf5e1b68f7aef565
@@@ -26,9 -26,7 +26,8 @@@
  #include <linux/platform_device.h>
  #include <linux/jiffies.h>
  #include <linux/io.h>
- #include <mach/common.h>
 +#include <linux/pinctrl/consumer.h>
+ #include <linux/stmp_device.h>
  
  #define DRIVER_NAME "mxs-i2c"
  
@@@ -112,13 -110,9 +111,9 @@@ struct mxs_i2c_dev 
        struct i2c_adapter adapter;
  };
  
- /*
-  * TODO: check if calls to here are really needed. If not, we could get rid of
-  * mxs_reset_block and the mach-dependency. Needs an I2C analyzer, probably.
-  */
  static void mxs_i2c_reset(struct mxs_i2c_dev *i2c)
  {
-       mxs_reset_block(i2c->regs);
+       stmp_reset_block(i2c->regs);
        writel(MXS_I2C_IRQ_MASK << 8, i2c->regs + MXS_I2C_CTRL1_SET);
        writel(MXS_I2C_QUEUECTRL_PIO_QUEUE_MODE,
                        i2c->regs + MXS_I2C_QUEUECTRL_SET);
@@@ -228,7 -222,6 +223,7 @@@ static int mxs_i2c_xfer_msg(struct i2c_
                return -EINVAL;
  
        init_completion(&i2c->cmd_complete);
 +      i2c->cmd_err = 0;
  
        flags = stop ? MXS_I2C_CTRL0_POST_SEND_STOP : 0;
  
  
        if (i2c->cmd_err == -ENXIO)
                mxs_i2c_reset(i2c);
 +      else
 +              writel(MXS_I2C_QUEUECTRL_QUEUE_RUN,
 +                              i2c->regs + MXS_I2C_QUEUECTRL_CLR);
  
        dev_dbg(i2c->dev, "Done with err=%d\n", i2c->cmd_err);
  
@@@ -304,6 -294,8 +299,6 @@@ static irqreturn_t mxs_i2c_isr(int this
                    MXS_I2C_CTRL1_SLAVE_STOP_IRQ | MXS_I2C_CTRL1_SLAVE_IRQ))
                /* MXS_I2C_CTRL1_OVERSIZE_XFER_TERM_IRQ is only for slaves */
                i2c->cmd_err = -EIO;
 -      else
 -              i2c->cmd_err = 0;
  
        is_last_cmd = (readl(i2c->regs + MXS_I2C_QUEUESTAT) &
                MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK) == 0;
@@@ -326,15 -318,10 +321,15 @@@ static int __devinit mxs_i2c_probe(stru
        struct device *dev = &pdev->dev;
        struct mxs_i2c_dev *i2c;
        struct i2c_adapter *adap;
 +      struct pinctrl *pinctrl;
        struct resource *res;
        resource_size_t res_size;
        int err, irq;
  
 +      pinctrl = devm_pinctrl_get_select_default(dev);
 +      if (IS_ERR(pinctrl))
 +              return PTR_ERR(pinctrl);
 +
        i2c = devm_kzalloc(dev, sizeof(struct mxs_i2c_dev), GFP_KERNEL);
        if (!i2c)
                return -ENOMEM;
@@@ -392,6 -379,8 +387,6 @@@ static int __devexit mxs_i2c_remove(str
        if (ret)
                return -EBUSY;
  
 -      writel(MXS_I2C_QUEUECTRL_QUEUE_RUN,
 -                      i2c->regs + MXS_I2C_QUEUECTRL_CLR);
        writel(MXS_I2C_CTRL0_SFTRST, i2c->regs + MXS_I2C_CTRL0_SET);
  
        platform_set_drvdata(pdev, NULL);
diff --combined lib/Kconfig
index 98230ac3db29327544535a5d9500ce07e0fae649,c5da1548b964317c0a26f35f56f3c50ad06c638d..3e63af08908243be1f2bfc111e4356864802df3d
@@@ -16,9 -16,6 +16,9 @@@ config BITREVERS
  config RATIONAL
        boolean
  
 +config GENERIC_STRNCPY_FROM_USER
 +      bool
 +
  config GENERIC_FIND_FIRST_BIT
        bool
  
@@@ -36,6 -33,9 +36,9 @@@ config GENERIC_I
        boolean
        default n
  
+ config STMP_DEVICE
+       bool
  config CRC_CCITT
        tristate "CRC-CCITT functions"
        help
@@@ -356,14 -356,6 +359,14 @@@ config CORDI
          This option provides an implementation of the CORDIC algorithm;
          calculations are in fixed point. Module will be called cordic.
  
 +config DDR
 +      bool "JEDEC DDR data"
 +      help
 +        Data from JEDEC specs for DDR SDRAM memories,
 +        particularly the AC timing parameters and addressing
 +        information. This data is useful for drivers handling
 +        DDR SDRAM controllers.
 +
  config MPILIB
        tristate
        select CLZ_TAB
diff --combined lib/Makefile
index b98df505f335de2e6562c3196d72f924f57f7f10,f78dbcdc7e3da93a9d076bdf9e834ffa38c28d1e..2a1d7f9d39a2349f7adce9413436ebe4fc583577
@@@ -123,10 -123,8 +123,12 @@@ obj-$(CONFIG_SIGNATURE) += digsig.
  
  obj-$(CONFIG_CLZ_TAB) += clz_tab.o
  
 +obj-$(CONFIG_DDR) += jedec_ddr_data.o
 +
 +obj-$(CONFIG_GENERIC_STRNCPY_FROM_USER) += strncpy_from_user.o
 +
+ obj-$(CONFIG_STMP_DEVICE) += stmp_device.o
  hostprogs-y   := gen_crc32table
  clean-files   := crc32table.h