Linux Audio

Check our new training course

Real-Time Linux with PREEMPT_RT training

Feb 18-20, 2025
Register
Loading...
Note: File does not exist in v6.2.
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 * Copyright (C) 2021-2023 Digiteq Automotive
 4 *     author: Martin Tuma <martin.tuma@digiteqautomotive.com>
 5 */
 6
 7#ifndef __MGB4_I2C_H__
 8#define __MGB4_I2C_H__
 9
10#include <linux/i2c.h>
11
12struct mgb4_i2c_client {
13	struct i2c_client *client;
14	int addr_size;
15};
16
17struct mgb4_i2c_kv {
18	u16 reg;
19	u8 mask;
20	u8 val;
21};
22
23int mgb4_i2c_init(struct mgb4_i2c_client *client, struct i2c_adapter *adap,
24		  struct i2c_board_info const *info, int addr_size);
25void mgb4_i2c_free(struct mgb4_i2c_client *client);
26
27s32 mgb4_i2c_read_byte(struct mgb4_i2c_client *client, u16 reg);
28s32 mgb4_i2c_write_byte(struct mgb4_i2c_client *client, u16 reg, u8 val);
29s32 mgb4_i2c_mask_byte(struct mgb4_i2c_client *client, u16 reg, u8 mask,
30		       u8 val);
31
32int mgb4_i2c_configure(struct mgb4_i2c_client *client,
33		       const struct mgb4_i2c_kv *values, size_t count);
34
35#endif