diff options
author | Tom Rix <trix@redhat.com> | 2022-03-12 16:48:45 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-05-13 11:02:17 +0200 |
commit | 97f05aad997567fa3e6301bf92074f501f8d01a3 (patch) | |
tree | 851cc89cd7b39ac35d92505bc548999250c5bbc9 /drivers/media/cec | |
parent | media: i2c: rdacm2x: properly set subdev entity function (diff) | |
download | linux-97f05aad997567fa3e6301bf92074f501f8d01a3.tar.xz linux-97f05aad997567fa3e6301bf92074f501f8d01a3.zip |
media: cec: seco: remove byte handling from smb_word_op
smb_word_op() has a parameter data_format that
determines if the data is either a byte or
word. From inspection, smb_word_op() is only
used by the macros smb_wr16() and smb_rd16()
both pass in CMD_WORD_DATA. There is no use of
smb_word_op() that passes in CMD_BYTE_DATA.
So remove the byte handling.
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/cec')
-rw-r--r-- | drivers/media/cec/platform/seco/seco-cec.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/media/cec/platform/seco/seco-cec.c b/drivers/media/cec/platform/seco/seco-cec.c index 51a6fcfd077d..580905e3d066 100644 --- a/drivers/media/cec/platform/seco/seco-cec.c +++ b/drivers/media/cec/platform/seco/seco-cec.c @@ -31,29 +31,17 @@ struct secocec_data { int irq; }; -#define smb_wr16(cmd, data) smb_word_op(CMD_WORD_DATA, SECOCEC_MICRO_ADDRESS, \ - cmd, data, SMBUS_WRITE, NULL) -#define smb_rd16(cmd, res) smb_word_op(CMD_WORD_DATA, SECOCEC_MICRO_ADDRESS, \ +#define smb_wr16(cmd, data) smb_word_op(SECOCEC_MICRO_ADDRESS, \ + cmd, data, SMBUS_WRITE, NULL) +#define smb_rd16(cmd, res) smb_word_op(SECOCEC_MICRO_ADDRESS, \ cmd, 0, SMBUS_READ, res) -static int smb_word_op(short data_format, u16 slave_addr, u8 cmd, u16 data, +static int smb_word_op(u16 slave_addr, u8 cmd, u16 data, u8 operation, u16 *result) { unsigned int count; - short _data_format; int status = 0; - switch (data_format) { - case CMD_BYTE_DATA: - _data_format = BRA_SMB_CMD_BYTE_DATA; - break; - case CMD_WORD_DATA: - _data_format = BRA_SMB_CMD_WORD_DATA; - break; - default: - return -EINVAL; - } - /* Active wait until ready */ for (count = 0; count <= SMBTIMEOUT; ++count) { if (!(inb(HSTS) & BRA_INUSE_STS)) @@ -75,7 +63,7 @@ static int smb_word_op(short data_format, u16 slave_addr, u8 cmd, u16 data, outb((u8)(data >> 8), HDAT1); } - outb(BRA_START + _data_format, HCNT); + outb(BRA_START + BRA_SMB_CMD_WORD_DATA, HCNT); for (count = 0; count <= SMBTIMEOUT; count++) { if (!(inb(HSTS) & BRA_HOST_BUSY)) |