1 /* SPDX-License-Identifier: GPL-2.0 */
3 * maxim_codec.h -- MAXIM codec common interface file
5 * Copyright (C) 2013 Samsung Electronics
6 * D Krishna Mohan <krishna.md@samsung.com>
9 #ifndef __MAXIM_COMMON_H__
10 #define __MAXIM_COMMON_H__
12 enum maxim_codec_type {
18 enum maxim_codec_type devtype;
25 #define MAXIM_AUDIO_I2C_BUS 7
26 #define MAXIM_AUDIO_I2C_REG_98095 0x22
28 #define MAXIM_AUDIO_I2C_REG MAXIM_AUDIO_I2C_REG_98095
31 * Writes value to a device register through i2c
33 * @param priv Private data for driver
34 * @param reg reg number to be write
35 * @param data data to be writen to the above registor
37 * @return int value 1 for change, 0 for no change or negative error code.
39 int maxim_i2c_write(struct maxim_priv *priv, unsigned int reg,
43 * Read a value from a device register through i2c
45 * @param priv Private data for driver
46 * @param reg reg number to be read
47 * @param data address of read data to be stored
49 * @return int value 0 for success, -1 in case of error.
51 unsigned int maxim_i2c_read(struct maxim_priv *priv, unsigned int reg,
55 * update device register bits through i2c
57 * @param priv Private data for driver
58 * @param reg codec register
59 * @param mask register mask
60 * @param value new value
62 * @return int value 0 for success, non-zero error code.
64 int maxim_bic_or(struct maxim_priv *priv, unsigned int reg, unsigned char mask,
67 #endif /* __MAXIM_COMMON_H__ */