[alsa-devel] [PATCH] ASoC: cs42l52: Report correct chip id and revision

Brian Austin brian.austin at cirrus.com
Fri Apr 4 19:00:45 CEST 2014


On Fri, 4 Apr 2014, Axel Lin wrote:

>
> 	ret = regmap_read(cs42l52->regmap, CS42L52_CHIP, &reg);
> -	devid = reg & CS42L52_CHIP_ID_MASK;
> +	devid = (reg & CS42L52_CHIP_ID_MASK) >> 3;

What you added does the same thing as what was already there.
The CHIP_ID is E0.

> 	if (devid != CS42L52_CHIP_ID) {
> 		ret = -ENODEV;
> 		dev_err(&i2c_client->dev,
> @@ -1259,7 +1259,7 @@ static int cs42l52_i2c_probe(struct i2c_client *i2c_client,
> 	}
>
> 	dev_info(&i2c_client->dev, "Cirrus Logic CS42L52, Revision: %02X\n",
> -			reg & 0xFF);
> +			reg & CS42L52_CHIP_REV_MASK);

This works
>
> 	/* Set Platform Data */
> 	if (cs42l52->pdata.mica_diff_cfg)
> -#define CS42L52_CHIP_ID				0xE0
> -#define CS42L52_CHIP_ID_MASK			0xF8
> +#define CS42L52_CHIP_ID				0x1C
> +#define CS42L52_CHIP_ID_MASK			(0x1F << 3)
> #define CS42L52_CHIP_REV_A0			0x00
> #define CS42L52_CHIP_REV_A1			0x01
> #define CS42L52_CHIP_REV_B0			0x02
> -#define CS42L52_CHIP_REV_MASK			0x03
> +#define CS42L52_CHIP_REV_B1			0x03

If you used this it would be cool, but your not so I don't see the need 
for it.

So if you want to add the code to actually display the REV_ID I would ack 
that, but I dont see anything that this patch actually fixes.

-Brian


More information about the Alsa-devel mailing list