1 // SPDX-License-Identifier: GPL-2.0
4 * Sony CXD2880 DVB-T2/T tuner + demodulator driver
5 * register I/O interface functions
7 * Copyright (C) 2016, 2017, 2018 Sony Semiconductor Solutions Corporation
10 #include "cxd2880_io.h"
12 int cxd2880_io_common_write_one_reg(struct cxd2880_io
*io
,
13 enum cxd2880_io_tgt tgt
,
14 u8 sub_address
, u8 data
)
19 return io
->write_regs(io
, tgt
, sub_address
, &data
, 1);
22 int cxd2880_io_set_reg_bits(struct cxd2880_io
*io
,
23 enum cxd2880_io_tgt tgt
,
24 u8 sub_address
, u8 data
, u8 mask
)
37 ret
= io
->read_regs(io
, tgt
, sub_address
, &rdata
, 1);
41 data
= (data
& mask
) | (rdata
& (mask
^ 0xff));
44 return io
->write_reg(io
, tgt
, sub_address
, data
);
47 int cxd2880_io_write_multi_regs(struct cxd2880_io
*io
,
48 enum cxd2880_io_tgt tgt
,
49 const struct cxd2880_reg_value reg_value
[],
58 for (i
= 0; i
< size
; i
++) {
59 ret
= io
->write_reg(io
, tgt
, reg_value
[i
].addr
,