From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH 1/3] mfd: tps6586x: add version detection Date: Wed, 27 Nov 2013 16:14:15 +0000 Message-ID: <20131127161415.GT3296@lee--X1> References: <20131127130954.GF3296@lee--X1> <20131127135547.GK3296@lee--X1> <20131127143429.GN3296@lee--X1> <20131127143641.GO3296@lee--X1> <20131127153019.GR3296@lee--X1> <89dbf704d8617c77259e04753e4380c9@agner.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <89dbf704d8617c77259e04753e4380c9-XLVq0VzYD2Y@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Stefan Agner Cc: swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org, thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: linux-tegra@vger.kernel.org On Wed, 27 Nov 2013, Stefan Agner wrote: > Am 2013-11-27 16:30, schrieb Lee Jones: > > On Wed, 27 Nov 2013, Stefan Agner wrote: > >=20 > >> Am 2013-11-27 15:36, schrieb Lee Jones: > >> > >> >> Perhaps I should suggest to make TPS6586X_ANY a positive number= then, > >> >> as a negative value to me indicates more of an error than a gen= eric > >> >> parameter. > >> I see, its especially confusing since the version is filled using = the > >> i2c_smbus_read_byte_data functions return value. The version field= is a > >> 8-Bit value according to the data sheet, I could use 0x100 as > >> TPS6586X_ANY identifier. > >=20 > > How far are we away from using 0xFF? > >=20 > > I'd be happy to use that and change it _if_ we ever get close. > >=20 > > If it's likely that it'll be used, then sure 0x100 sounds okay too. >=20 > Yes, I thought about 0xFF too. The latest device we support is TPS658= 643 > (according to data sheet release dates), which has the smallest versi= on > number (03). Since it seems to be a CRC (hence VERSIONCRC) the number= is > quite random. Also, 0xFF sounds like a bitmask which can mask all > versions, but the versions can't be used bitwise... So I would prefer= to > go with 0x100. Deal! --=20 Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org =E2=94=82 Open source software for ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog