drm/rockchip: Don't change hdmi reference clock rate
[drm/drm-misc.git] / drivers / media / pci / mgb4 / mgb4_i2c.h
blobfac6a16344742eeb6fc313a9dea5b84c5cc04e0f
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 */
7 #ifndef __MGB4_I2C_H__
8 #define __MGB4_I2C_H__
10 #include <linux/i2c.h>
12 struct mgb4_i2c_client {
13 struct i2c_client *client;
14 int addr_size;
17 struct mgb4_i2c_kv {
18 u16 reg;
19 u8 mask;
20 u8 val;
23 int mgb4_i2c_init(struct mgb4_i2c_client *client, struct i2c_adapter *adap,
24 struct i2c_board_info const *info, int addr_size);
25 void mgb4_i2c_free(struct mgb4_i2c_client *client);
27 s32 mgb4_i2c_read_byte(struct mgb4_i2c_client *client, u16 reg);
28 s32 mgb4_i2c_write_byte(struct mgb4_i2c_client *client, u16 reg, u8 val);
29 s32 mgb4_i2c_mask_byte(struct mgb4_i2c_client *client, u16 reg, u8 mask,
30 u8 val);
32 int mgb4_i2c_configure(struct mgb4_i2c_client *client,
33 const struct mgb4_i2c_kv *values, size_t count);
35 #endif