1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2010 Stefano Babic <sbabic@denx.de>
9 #include <linux/errno.h>
10 #include <linux/types.h>
14 #ifndef CONFIG_SYS_FSL_MC9SDZ60_I2C_ADDR
15 #error "You have to configure I2C address for MC9SDZ60"
19 u8 mc9sdz60_reg_read(enum mc9sdz60_reg reg)
23 if (i2c_read(CONFIG_SYS_FSL_MC9SDZ60_I2C_ADDR, reg, 1, &val, 1)) {
24 puts("Error reading MC9SDZ60 register\n");
31 void mc9sdz60_reg_write(enum mc9sdz60_reg reg, u8 val)
33 i2c_write(CONFIG_SYS_FSL_MC9SDZ60_I2C_ADDR, reg, 1, &val, 1);