Linux I2C development
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Felipe Balbi <me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org>
Cc: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>,
	i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [PATCH] I2C: ISP1301: Sync with linux-omap
Date: Tue, 18 Mar 2008 13:46:33 +0100	[thread overview]
Message-ID: <20080318134633.16f6e5f1@hyperion.delvare> (raw)
In-Reply-To: <20080316110033.GB4503-4vvIQG7NF+ITKvXZea5imILpUPVTGn5w@public.gmane.org>

Hi Felipe,

On Sun, 16 Mar 2008 13:00:35 +0200, Felipe Balbi wrote:
> There are some changes on linux-omap's isp1301_omap.c
> that could already be in linux-mainline after
> omap1/2 got merged.
> 
> This patch sync such changes from linux-omap into linux-mailine.

I fear I will need a better description than this. Please explain what
the changes are and why they are needed. "sync with an external tree"
isn't sufficient.

> 
> Signed-off-by: Felipe Balbi <me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org>
> ---
>  drivers/i2c/chips/isp1301_omap.c |   40 +++++++++++++++++++++++++++++--------
>  1 files changed, 31 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/i2c/chips/isp1301_omap.c b/drivers/i2c/chips/isp1301_omap.c
> index 9f2ccaf..9e3a6f3 100644
> --- a/drivers/i2c/chips/isp1301_omap.c
> +++ b/drivers/i2c/chips/isp1301_omap.c
> @@ -84,7 +84,8 @@ struct isp1301 {
>  
>  /*-------------------------------------------------------------------------*/
>  
> -#ifdef	CONFIG_MACH_OMAP_H2
> +#if	defined(CONFIG_MACH_OMAP_H2) || \
> +	defined(CONFIG_MACH_OMAP_H3)
>  
>  /* board-specific PM hooks */
>  
> @@ -122,17 +123,30 @@ static void enable_vbus_source(struct isp1301 *isp)
>  }
>  
>  
> -/* products will deliver OTG messages with LEDs, GUI, etc */
> -static inline void notresponding(struct isp1301 *isp)
> +#else
> +
> +static void enable_vbus_draw(struct isp1301 *isp, unsigned mA)
>  {
> -	printk(KERN_NOTICE "OTG device not responding.\n");
> +	pr_debug("%s UNIMPL\n", __FUNCTION__);
>  }
>  
> +static void enable_vbus_source(struct isp1301 *isp)
> +{
> +	pr_debug("%s UNIMPL\n", __FUNCTION__);
> +}
>  
>  #endif
>  
>  /*-------------------------------------------------------------------------*/
>  
> +/* products will deliver OTG messages with LEDs, GUI, etc */
> +static inline void notresponding(struct isp1301 *isp)
> +{
> +	printk(KERN_NOTICE "OTG device not responding.\n");
> +}
> +
> +/*-------------------------------------------------------------------------*/
> +
>  /* only two addresses possible */
>  static struct i2c_driver isp1301_driver;
>  
> @@ -495,6 +509,7 @@ static inline void check_state(struct isp1301 *isp, const char *tag) { }
>  static void update_otg1(struct isp1301 *isp, u8 int_src)
>  {
>  	u32	otg_ctrl;
> +	u8      int_id;
>  
>  	otg_ctrl = OTG_CTRL_REG
>  			& OTG_CTRL_MASK
> @@ -508,7 +523,10 @@ static void update_otg1(struct isp1301 *isp, u8 int_src)
>  	}
>  	if (int_src & INTR_VBUS_VLD)
>  		otg_ctrl |= OTG_VBUSVLD;
> -	if (int_src & INTR_ID_GND) {		/* default-A */
> +
> +	int_id = isp1301_get_u8(isp, ISP1301_INTERRUPT_SOURCE);
> +
> +	if (int_id & INTR_ID_GND) {		/* default-A */
>  		if (isp->otg.state == OTG_STATE_B_IDLE
>  				|| isp->otg.state == OTG_STATE_UNDEFINED) {
>  			a_idle(isp, "init");
> @@ -1063,7 +1081,7 @@ static void isp_update_otg(struct isp1301 *isp, u8 stat)
>  	/* update the OTG controller state to match the isp1301; may
>  	 * trigger OPRT_CHG irqs for changes going to the isp1301.
>  	 */
> -	update_otg1(isp, isp_stat);
> +	update_otg1(isp, isp_stat); /* pass the actual interrupt latch status */
>  	update_otg2(isp, isp_bstat);
>  	check_state(isp, __FUNCTION__);
>  #endif
> @@ -1337,13 +1355,13 @@ isp1301_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *gadget)
>  	power_up(isp);
>  	isp->otg.state = OTG_STATE_B_IDLE;
>  
> -	if (machine_is_omap_h2())
> +	if (machine_is_omap_h2() || machine_is_omap_h3())
>  		isp1301_set_bits(isp, ISP1301_MODE_CONTROL_1, MC1_DAT_SE0);
>  
>  	isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING,
> -		INTR_SESS_VLD);
> +		INTR_SESS_VLD | INTR_VBUS_VLD);
>  	isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING,
> -		INTR_VBUS_VLD);
> +		INTR_VBUS_VLD | INTR_SESS_VLD);
>  	dev_info(&isp->client->dev, "B-Peripheral sessions ok\n");
>  	dump_regs(isp, __func__);
>  
> @@ -1420,6 +1438,10 @@ isp1301_start_hnp(struct otg_transceiver *dev)
>  	 * So do this part as early as possible...
>  	 */
>  	switch (isp->otg.state) {
> +	case OTG_STATE_B_PERIPHERAL:
> +		isp->otg.state = OTG_STATE_B_WAIT_ACON;
> +		isp1301_defer_work(isp, WORK_UPDATE_ISP);
> +		break;
>  	case OTG_STATE_B_HOST:
>  		isp->otg.state = OTG_STATE_B_PERIPHERAL;
>  		/* caller will suspend next */


-- 
Jean Delvare

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

  parent reply	other threads:[~2008-03-18 12:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-15 12:47 [PATH 0/3] isp1301 changes Felipe Balbi
     [not found] ` <1205585237-21492-1-git-send-email-me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org>
2008-03-15 12:47   ` [PATCH] I2C: Introduce irq_flags in i2c_boardinfo and i2c_client Felipe Balbi
     [not found]     ` <1205585237-21492-2-git-send-email-me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org>
2008-03-15 12:47       ` [PATCH] I2C: ISP1301_OMAP: New-style i2c driver updates, part 1 Felipe Balbi
     [not found]         ` <1205585237-21492-3-git-send-email-me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org>
2008-03-15 12:47           ` [PATCH] I2C: ISP1301_OMAP: New-style i2c driver updates, part 2 Felipe Balbi
     [not found]             ` <1205585237-21492-4-git-send-email-me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org>
2008-03-15 12:49               ` Felipe Balbi
     [not found]                 ` <20080315124918.GA21547-4vvIQG7NF+ITKvXZea5imILpUPVTGn5w@public.gmane.org>
2008-03-15 12:54                   ` Felipe Balbi
     [not found]                     ` <20080315125458.GB21547-4vvIQG7NF+ITKvXZea5imILpUPVTGn5w@public.gmane.org>
2008-03-15 13:13                       ` Felipe Balbi
     [not found]                         ` <20080315131309.GA24990-4vvIQG7NF+ITKvXZea5imILpUPVTGn5w@public.gmane.org>
2008-03-16 10:56                           ` Felipe Balbi
     [not found]                             ` <20080316105617.GA4503-4vvIQG7NF+ITKvXZea5imILpUPVTGn5w@public.gmane.org>
2008-03-16 11:00                               ` [PATCH] I2C: ISP1301: Sync with linux-omap Felipe Balbi
     [not found]                                 ` <20080316110033.GB4503-4vvIQG7NF+ITKvXZea5imILpUPVTGn5w@public.gmane.org>
2008-03-16 17:59                                   ` David Brownell
     [not found]                                     ` <200803161059.52278.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-03-16 18:18                                       ` Felipe Balbi
2008-03-18 12:46                                   ` Jean Delvare [this message]
     [not found]                                     ` <20080318134633.16f6e5f1-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-18 13:09                                       ` Felipe Balbi
     [not found]                                         ` <31e679430803180609s2b404dabu1cac2e09f128ba96-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-03-18 13:23                                           ` Jean Delvare
     [not found]                                             ` <20080318142337.0f9a2b5b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-18 13:28                                               ` Felipe Balbi
     [not found]                                                 ` <31e679430803180628h7a4926a2t4e540d9617522e28-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-03-20  9:39                                                   ` David Brownell
2008-03-16 17:55                               ` [PATCH] I2C: ISP1301_OMAP: New-style i2c driver updates, part 2 David Brownell
2008-03-18 12:42                               ` Jean Delvare
     [not found]                                 ` <20080318134259.1b7e2878-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-18 13:06                                   ` Felipe Balbi
     [not found]                                     ` <31e679430803180606w51e5538ar1df7fbdfa5a0e894-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-03-18 13:27                                       ` Jean Delvare
     [not found]                                         ` <20080318142716.74d65ba1-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-20  9:44                                           ` David Brownell
2008-03-18 13:15                               ` Jean Delvare
     [not found]                                 ` <20080318141528.53f4b2d8-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-18 13:25                                   ` Felipe Balbi
2008-03-20  9:56                               ` David Brownell
2008-03-31 17:37                               ` Ben Dooks
     [not found]                                 ` <20080331173749.GA10234-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-03-31 18:41                                   ` Jean Delvare
2008-03-15 15:28   ` [PATH 0/3] isp1301 changes Jean Delvare
     [not found]     ` <20080315162832.067b8088-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-15 15:38       ` Felipe Balbi
     [not found]         ` <31e679430803150838n6638be05k53800bb74eeb3462-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-03-15 15:40           ` Felipe Balbi
     [not found]             ` <31e679430803150840p334e8d17ncdd1fdc431de8d82-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-03-15 16:47               ` Jean Delvare
     [not found]                 ` <20080315174731.29cfb554-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-15 23:22                   ` Felipe Balbi
2008-03-16  3:57               ` David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080318134633.16f6e5f1@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=me-uiRdBs8odbtmTBlB0Cgj/Q@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox