]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/i2c/sh_i2c.c
mtd: nand: omap_gpmc: support flash based BBT
[karo-tx-uboot.git] / drivers / i2c / sh_i2c.c
index afcb503f95412e7bf09cdc0e166cc3486b9609c9..58f8bf1bd5186514fee72dff28d64764e36431f6 100644 (file)
@@ -2,20 +2,7 @@
  * Copyright (C) 2011 Renesas Solutions Corp.
  * Copyright (C) 2011 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -98,8 +85,8 @@ static int i2c_set_addr(struct sh_i2c *base, u8 id, u8 reg, int stop)
 {
        u8 icic = SH_IC_TACK;
 
-       writeb(readb(&base->iccr) & ~SH_I2C_ICCR_ICE, &base->iccr);
-       writeb(readb(&base->iccr) | SH_I2C_ICCR_ICE, &base->iccr);
+       clrbits_8(&base->iccr, SH_I2C_ICCR_ICE);
+       setbits_8(&base->iccr, SH_I2C_ICCR_ICE);
 
        writeb(iccl & 0xff, &base->iccl);
        writeb(icch & 0xff, &base->icch);
@@ -114,7 +101,7 @@ static int i2c_set_addr(struct sh_i2c *base, u8 id, u8 reg, int stop)
        writeb((SH_I2C_ICCR_ICE|SH_I2C_ICCR_RTS|SH_I2C_ICCR_BUSY), &base->iccr);
        irq_dte(base);
 
-       writeb(readb(&base->icsr) & ~SH_IC_TACK, &base->icsr);
+       clrbits_8(&base->icsr, SH_IC_TACK);
        writeb(id << 1, &base->icdr);
        if (irq_dte_with_tack(base) != 0)
                return -1;
@@ -131,7 +118,7 @@ static int i2c_set_addr(struct sh_i2c *base, u8 id, u8 reg, int stop)
 static void i2c_finish(struct sh_i2c *base)
 {
        writeb(0, &base->icsr);
-       writeb(readb(&base->iccr) & ~SH_I2C_ICCR_ICE, &base->iccr);
+       clrbits_8(&base->iccr, SH_I2C_ICCR_ICE);
 }
 
 static int i2c_raw_write(struct sh_i2c *base, u8 id, u8 reg, u8 val)