On Mon, Jan 20, 2014 at 10:00:15AM +0800, Li Jun wrote:
> This patch adds HNP polling operation function for OTG fsm.
> 
> Signed-off-by: Li Jun <b47...@freescale.com>
> ---
>  drivers/usb/phy/phy-fsm-usb.c |    2 ++
>  include/linux/usb/otg-fsm.h   |    9 +++++++++
>  2 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/phy/phy-fsm-usb.c b/drivers/usb/phy/phy-fsm-usb.c
> index c47e5a6..ef91961 100644
> --- a/drivers/usb/phy/phy-fsm-usb.c
> +++ b/drivers/usb/phy/phy-fsm-usb.c
> @@ -169,6 +169,7 @@ static int otg_set_state(struct otg_fsm *fsm, enum 
> usb_otg_state new_state)
>               otg_set_protocol(fsm, PROTO_HOST);
>               usb_bus_start_enum(fsm->otg->host,
>                               fsm->otg->host->otg_port);
> +             otg_start_hnp_polling(fsm);
>               break;
>       case OTG_STATE_A_IDLE:
>               otg_drv_vbus(fsm, 0);
> @@ -203,6 +204,7 @@ static int otg_set_state(struct otg_fsm *fsm, enum 
> usb_otg_state new_state)
>                */
>               if (!fsm->a_bus_req || fsm->a_suspend_req_inf)
>                       otg_add_timer(fsm, A_WAIT_ENUM);
> +             otg_start_hnp_polling(fsm);
>               break;
>       case OTG_STATE_A_SUSPEND:
>               otg_drv_vbus(fsm, 1);
> diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h
> index b6ba1bf..79c6ee8 100644
> --- a/include/linux/usb/otg-fsm.h
> +++ b/include/linux/usb/otg-fsm.h
> @@ -127,6 +127,7 @@ struct otg_fsm_ops {
>       void    (*start_pulse)(struct otg_fsm *fsm);
>       void    (*start_adp_prb)(struct otg_fsm *fsm);
>       void    (*start_adp_sns)(struct otg_fsm *fsm);
> +     void    (*start_hnp_polling)(struct otg_fsm *fsm);

why ? HNP polling is a generic operation, is it not ? Which means you
shouldn't need to add this function pointer here, just implement a
generic helper function, ideally in usb-common.c

Also, I need to see a patch adding proper kernel doc to those
structures.

cheers

-- 
balbi

Attachment: signature.asc
Description: Digital signature

Reply via email to