RE: [patch FYI] twl4030 dumps revision info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>Sent: Wednesday, October 15, 2008 11:24 PM
>To: linux-omap@xxxxxxxxxxxxxxx
>Subject: [patch FYI] twl4030 dumps revision info
>
>
>---
> drivers/mfd/twl4030-core.c |   62 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 62 insertions(+)
>
>+};
>+
>+static u32 twl_id(struct device *dev)
>+{
>+	const u32 mask = ((1 << 16) - 1) << 12;
>+	union { u8 bytes[4]; u32 word; } idcode;
>+	int status;
>+	u8 nibble;
>+	char *chip;
>+	const struct es_desc *desc;
>+
>+	status = twl4030_i2c_read(TWL4030_MODULE_INTBR,
>+			idcode.bytes, 0, 4);
>+	if (status < 0)
>+		return 0;
>+
>+	idcode.word = le32_to_cpu(idcode.word),

End of line should be ;
	Hope you are not using , operator :-) 

>+	nibble = idcode.word >> 28;
>+
>+	/* NOTE:  TWL5030 / TPS65930 ES1.0 mis-identifies as TWL4030 */
>+
>+	if ((idcode.word & mask) == (0x0009002F & mask)) {
>+		chip = "TWL4030";
>+		desc = twl4030_es;
>+	} else if ((idcode.word & mask) == (0x0009802F & mask)) {
>+		chip = "TWL5030";
>+		desc = twl5030_es;
>+	} else {
>+		chip = "unrecognized";
>+		desc = NULL;
>+	}
>+
>+	while (desc && desc->name[0]) {
>+		if (desc->nibble == nibble) {
>+			dev_info(dev, "%s ES %s; idcode %08x\n",
>+					chip, desc->name, idcode.word);
>+			return idcode.word;
>+		}
>+		desc++;
>+	}
>+	dev_info(dev, "%s; idcode %08x\n", chip, idcode.word);
>+	return idcode.word;
>+}
>+
> /* NOTE:  this driver only handles a single twl4030/tps659x0 chip */
> static int
> twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id)
>@@ -795,6 +855,8 @@ twl4030_probe(struct i2c_client *client,
>
> 	if(0)dumpit();
>
>+	twl_id(&client->dev);
>+
> 	/* setup clock framework */
> 	clocks_init();
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>the body of a message to majordomo@xxxxxxxxxxxxxxx
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux