Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6f5a718 authored by Maciej S. Szmigiero's avatar Maciej S. Szmigiero Committed by Greg Kroah-Hartman
Browse files

media: saa7134: fix terminology around saa7134_i2c_eeprom_md7134_gate()



[ Upstream commit 9d802222a3405599d6e1984d9324cddf592ea1f4 ]

saa7134_i2c_eeprom_md7134_gate() function and the associated comment uses
an inverted i2c gate open / closed terminology.
Let's fix this.

Signed-off-by: default avatarMaciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: fix alignment checkpatch warning]
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 844824db
Loading
Loading
Loading
Loading
+8 −4
Original line number Original line Diff line number Diff line
@@ -355,7 +355,11 @@ static struct i2c_client saa7134_client_template = {


/* ----------------------------------------------------------- */
/* ----------------------------------------------------------- */


/* On Medion 7134 reading EEPROM needs DVB-T demod i2c gate open */
/*
 * On Medion 7134 reading the SAA7134 chip config EEPROM needs DVB-T
 * demod i2c gate closed due to an address clash between this EEPROM
 * and the demod one.
 */
static void saa7134_i2c_eeprom_md7134_gate(struct saa7134_dev *dev)
static void saa7134_i2c_eeprom_md7134_gate(struct saa7134_dev *dev)
{
{
	u8 subaddr = 0x7, dmdregval;
	u8 subaddr = 0x7, dmdregval;
@@ -372,13 +376,13 @@ static void saa7134_i2c_eeprom_md7134_gate(struct saa7134_dev *dev)


	ret = i2c_transfer(&dev->i2c_adap, i2cgatemsg_r, 2);
	ret = i2c_transfer(&dev->i2c_adap, i2cgatemsg_r, 2);
	if ((ret == 2) && (dmdregval & 0x2)) {
	if ((ret == 2) && (dmdregval & 0x2)) {
		pr_debug("%s: DVB-T demod i2c gate was left closed\n",
		pr_debug("%s: DVB-T demod i2c gate was left open\n",
			 dev->name);
			 dev->name);


		data[0] = subaddr;
		data[0] = subaddr;
		data[1] = (dmdregval & ~0x2);
		data[1] = (dmdregval & ~0x2);
		if (i2c_transfer(&dev->i2c_adap, i2cgatemsg_w, 1) != 1)
		if (i2c_transfer(&dev->i2c_adap, i2cgatemsg_w, 1) != 1)
			pr_err("%s: EEPROM i2c gate open failure\n",
			pr_err("%s: EEPROM i2c gate close failure\n",
			       dev->name);
			       dev->name);
	}
	}
}
}