[PATCH 1/2] I2C: Convert PCF50606 to I2C device

Andy Green andy at openmoko.com
Fri Oct 3 13:11:24 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jonas Bonn wrote:
> This chip is a regular I2C device and does not really need to be set up
> as a platform device.  This patch thus changes the driver definition and
> converts the I2C bits to the new-style I2C interface at the same time.

>  	/* now we try to detect the chip */
> -
> -	/* register with i2c core */
> -	err = i2c_attach_client(new_client);
> -	if (err) {
> -		dev_err(&new_client->dev,
> -			"error during i2c_attach_client()\n");
> -		goto exit_free;
> -	}
> +	// FIXME: Detect chip????
> +	/* */

In I2C protocol if the chip at the address is not present it won't ACK
at the first opportunity and transactions will fail.  So all that's
needed here is first regular register transaction should bail from probe
if it returned -E*.

> -/* We have this purely to capture an early indication that we are coming out
> - * of suspend, before our device resume got called; async interrupt service is
> - * interested in this.
> - */
> -
> -static int pcf50606_plat_resume(struct platform_device *pdev)
> -{
> -	/* i2c_get_clientdata(to_i2c_client(&pdev->dev)) returns NULL at this
> -	 * early resume time so we have to use pcf50606_global
> -	 */
> -	pcf50606_global->suspend_state = PCF50606_SS_RESUMING_BUT_NOT_US_YET;
> -
> -	return 0;
> -}

Dunno about 50606 but I think the equivalent was important on 50633
resume sequencing.  Did you confirm it suspend / resumes OK still?

- -Andy

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkjl/dwACgkQOjLpvpq7dMr5rACbB/zJfObUHMRRUCkz2Yen49RT
dygAn2HV2+HUhzdk7EilkG7MT0sKrrnH
=+Lt1
-----END PGP SIGNATURE-----



More information about the openmoko-kernel mailing list