2 * (C) Copyright 2010 Stefano Babic <sbabic@denx.de>
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include <asm/errno.h>
27 #include <linux/types.h>
31 #ifndef CONFIG_SYS_FSL_MC9SDZ60_I2C_ADDR
32 #error "You have to configure I2C address for MC9SDZ60"
36 u8 mc9sdz60_reg_read(enum mc9sdz60_reg reg)
40 if (i2c_read(CONFIG_SYS_FSL_MC9SDZ60_I2C_ADDR, reg, 1, &val, 1)) {
41 puts("Error reading MC9SDZ60 register\n");
48 void mc9sdz60_reg_write(enum mc9sdz60_reg reg, u8 val)
50 i2c_write(CONFIG_SYS_FSL_MC9SDZ60_I2C_ADDR, reg, 1, &val, 1);