t; +
> +enum usb_charger_type imx_usbmisc_charger_secondary_det(
> + struct imx_usbmisc_data *data)
> +{
> + struct imx_usbmisc *usbmisc;
> +
> + if (!data)
> + return -EINVAL;
> +
> + usbmisc = dev_get_drvdata(data->dev);
> + if (!usbmisc->ops->charger_secondary_det)
> + return -EINVAL;
> + return usbmisc->ops->charger_secondary_det(data);
> +}
> +EXPORT_SYMBOL_GPL(imx_usbmisc_charger_secondary_det);
> +
> static const struct of_device_id usbmisc_imx_dt_ids[] = {
> {
> .compatible = "fsl,imx25-usbmisc",
> --
> 1.9.1
>
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
> void(*notify_event) (struct ci_hdrc *ci, unsigned event);
> + enum usb_charger_type (*usb_charger_det)(struct ci_hdrc *ci);
> + boolpull_dp_for_charger;
> + enum usb_charger_type (*usb_charger_secondary_det)(struct ci_hdrc *ci);
You may add some comments for above two variables.
> struct regulator*reg_vbus;
> struct usb_otg_caps ci_otg_caps;
> booltpl_support;
> --
> 1.9.1
>
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
information after the device under root hub is created,
so this movement will not affect current function.
Signed-off-by: Peter Chen <peter.c...@nxp.com>
Reported-by: Lars Steubesand <lars.steubes...@philips.com>
---
drivers/usb/core/hcd.c | 1 +
drivers/usb/core/usb.c | 1 -
2 file
information after the device under root hub is created,
so this movement will not affect current function.
Signed-off-by: Peter Chen <peter.c...@nxp.com>
Reported-by: Lars Steubesand <lars.steubes...@philips.com>
---
drivers/usb/core/hcd.c | 1 +
drivers/usb/core/usb.c | 1 -
2 file
On Wed, Apr 20, 2016 at 10:03:34AM +0300, Roger Quadros wrote:
> On 20/04/16 08:08, Yoshihiro Shimoda wrote:
> > Hi,
> >
> >> From: Peter Chen
> >> Sent: Tuesday, April 19, 2016 6:18 PM
> >>
> >> On Fri, Apr 15, 2016 at 10:03:16AM +, Y
On Fri, Apr 22, 2016 at 09:26:46AM +0800, Peter Chen wrote:
> On Fri, Apr 15, 2016 at 10:03:16AM +, Yoshihiro Shimoda wrote:
> > Hi,
> >
> > > From: Yoshihiro Shimoda
> > > Sent: Friday, April 15, 2016 6:59 PM
> > >
> > > Hi,
> > >
LAG_HCD_NEEDS_COMPANION (1 << 2)
> /* use otg->fsm.lock for serializing access */
>
> /*- deprecated interface -*/
> @@ -125,11 +127,14 @@ struct usb_otg_caps {
> * @caps: otg capabilities of the controller
> * @ops: otg fsm operations
> * @otg_work: optional custom otg state machine work function
> + * @hcd_needs_companion: Indicates if host controller needs a companion
> + *controller
> */
> struct usb_otg_config {
> struct usb_otg_caps *otg_caps;
> struct otg_fsm_ops *fsm_ops;
> void (*otg_work)(struct work_struct *work);
> + bool hcd_needs_companion;
> };
>
> extern const char *usb_otg_state_string(enum usb_otg_state state);
> --
Hi Yoshihiro, the shared_hcd is used for USB3 only [1], this patch may
not be suitable for supporting companion controller at OTG framework.
For companion or other USB2 controllers, both primary hcd and shard hcd
are NULL for HCD core.
[1] http://www.spinics.net/lists/linux-usb/msg139630.html
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Apr 19, 2016 at 12:20:18PM +0530, maitysancha...@gmail.com wrote:
> Hello Peter,
>
> On 16-04-19 10:40:20, Peter Chen wrote:
> > On Mon, Apr 18, 2016 at 02:36:06PM +0530, maitysancha...@gmail.com wrote:
> > > Hello Peter,
> > >
> > > I t
; + * --- internal use only ---
> + * @primary_hcd: primary host state and interface
> + * @shared_hcd: shared host state and interface
> + * @gadget_ops: gadget controller interface
> + * @list: list of otg controllers
>
On Tue, Apr 19, 2016 at 10:20:33AM -0400, Alan Stern wrote:
> On Tue, 19 Apr 2016, Felipe Balbi wrote:
>
> > Hi,
> >
> > Peter Chen <hzpeterc...@gmail.com> writes:
> > > Hi all,
> > >
> > > When I review the patch [1] for adding companion
On Wed, Apr 20, 2016 at 11:15:30AM +0300, Roger Quadros wrote:
> On 19/04/16 04:56, Peter Chen wrote:
> > On Mon, Apr 18, 2016 at 10:11:29AM -0400, Alan Stern wrote:
> >> On Mon, 18 Apr 2016, Peter Chen wrote:
> >>
> >>> On Wed, Apr 06, 2016 at 09:32:22AM +
On Wed, Apr 20, 2016 at 10:02:33AM +0300, Roger Quadros wrote:
> On 19/04/16 11:06, Peter Chen wrote:
> > On Tue, Apr 05, 2016 at 05:05:12PM +0300, Roger Quadros wrote:
> >> +/**
> >> + * usb_otg_start_host - start/stop the host controller
>
On Wed, Apr 20, 2016 at 09:54:49AM +0300, Roger Quadros wrote:
> On 18/04/16 05:09, Peter Chen wrote:
> > On Fri, Apr 15, 2016 at 02:00:46PM +0300, Roger Quadros wrote:
> >> On 15/04/16 12:25, Peter Chen wrote:
> >>> On Tue, Apr 05, 2016 at 05:05:1
On Wed, Apr 20, 2016 at 10:41:42AM +0300, Felipe Balbi wrote:
> Peter Chen <hzpeterc...@gmail.com> writes:
> > On Tue, Apr 19, 2016 at 10:20:33AM -0400, Alan Stern wrote:
> >> On Tue, 19 Apr 2016, Felipe Balbi wrote:
> >>
> >> > Hi,
> >&g
On Tue, Apr 19, 2016 at 10:20:33AM -0400, Alan Stern wrote:
> On Tue, 19 Apr 2016, Felipe Balbi wrote:
>
> > Hi,
> >
> > Peter Chen <hzpeterc...@gmail.com> writes:
> > > Hi all,
> > >
> > > When I review the patch [1] for adding companion
it? Thanks.
[1] http://www.spinics.net/lists/linux-usb/msg139344.html
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
ags;
> #define OTG_FLAG_GADGET_RUNNING (1 << 0)
> #define OTG_FLAG_HOST_RUNNING (1 << 1)
> +#define OTG_FLAG_HCD_NEEDS_COMPANION (1 << 2)
> /* use otg->fsm.lock for serializing access */
>
> /*- deprecated interface -*/
> @@ -125,11 +127,14 @@ struct usb_otg_caps {
> * @caps: otg capabilities of the controller
> * @ops: otg fsm operations
> * @otg_work: optional custom otg state machine work function
> + * @hcd_needs_companion: Indicates if host controller needs a companion
> + *controller
> */
> struct usb_otg_config {
> struct usb_otg_caps *otg_caps;
> struct otg_fsm_ops *fsm_ops;
> void (*otg_work)(struct work_struct *work);
> + bool hcd_needs_companion;
> };
>
> extern const char *usb_otg_state_string(enum usb_otg_state state);
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Apr 06, 2016 at 10:13:52AM +0300, Roger Quadros wrote:
> On 06/04/16 09:46, Peter Chen wrote:
> > On Tue, Apr 05, 2016 at 04:48:19PM +0300, Roger Quadros wrote:
> >> Peter,
> >>
> >> On 05/04/16 15:52, Roger Quadros wrote:
> >>> Peter,
On Mon, Apr 18, 2016 at 02:29:37PM +0800, Peter Chen wrote:
> On Tue, Apr 05, 2016 at 05:05:13PM +0300, Roger Quadros wrote:
> > Introduce usb_otg_add/remove_hcd() for use by host
> > controllers that are part of OTG/dual-role port.
> >
> > Non Device tree platforms c
belong to otg-fsm.
> +#endif /* __DRIVERS_USB_COMMON_USB_OTG_H */
> diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
> index ae228d0..b468a9f 100644
> --- a/drivers/usb/core/Kconfig
> +++ b/drivers/usb/core/Kconfig
> @@ -42,7 +42,7 @@ config USB_DYNAMIC_MINORS
On Mon, Apr 18, 2016 at 10:11:29AM -0400, Alan Stern wrote:
> On Mon, 18 Apr 2016, Peter Chen wrote:
>
> > On Wed, Apr 06, 2016 at 09:32:22AM +0300, Roger Quadros wrote:
> > > On 06/04/16 09:09, Felipe Balbi wrote:
> > > >
> > > > Hi,
> >
794e2 100644
> --- a/drivers/usb/phy/Kconfig
> +++ b/drivers/usb/phy/Kconfig
> @@ -20,7 +20,7 @@ config AB8500_USB
>
> config FSL_USB2_OTG
> bool "Freescale USB OTG Transceiver Driver"
> - depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_OTG_F
On Tue, Apr 05, 2016 at 05:05:09PM +0300, Roger Quadros wrote:
> This is to prevent missing symbol build error if OTG is
> enabled (built-in) and HCD core (CONFIG_USB) is module.
>
> Signed-off-by: Roger Quadros <rog...@ti.com>
Acked-by: Peter Chen <peter.c...@nxp.com&g
On Tue, Apr 05, 2016 at 05:05:08PM +0300, Roger Quadros wrote:
> Move otg_fsm into usb_otg and use usb_otg wherever possible
> in the usb_otg APIs.
>
> Signed-off-by: Roger Quadros <rog...@ti.com>
Acked-by: Peter Chen <peter.c...@nxp.com>
> ---
> drivers/
> + struct usb_device * (*usb_hub_find_child)(struct usb_device *hdev,
> + int port1);
> +};
> +
> static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd)
> {
> return hcd->driver->flags & HCD_BH;
&
CONFIG_USB_OTG
> + /* notify OTG fsm about a_set_b_hnp_enable change */
> + usb_otg_kick_fsm(hcd->otg_dev);
> +#endif
> + }
> }
>
> /* Some low speed devices have problems with the quick delay, so */
>
}
> +
> + pdev = of_find_device_by_node(np);
> + of_node_put(np);
> + if (!pdev) {
> + dev_err(parent, "couldn't get otg-controller device\n");
> + return -ENODEV;
> + }
> +
> + gadget->otg_dev = >dev;
> + } else {
> + gadget->otg_dev = otg_dev;
> + }
The above the code is duplicated with hcd's. Can we do something common
at usb-otg.c, eg define an API get_usb_otg_dev(struct usb_gadget *gadget, struct
usb_hcd *hcd), in this API we can try to get otg_dev for both gadget and
hcd, and we can call it at controller driver during register otg.
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
"couldn't get otg-controller device\n");
> + return -ENODEV;
> + }
> +
> + hcd->otg_dev = >dev;
> + } else {
> + hcd->otg_dev = otg_dev;
> + }
> +
> + return usb_otg_register_hcd(hcd, irqnum, irqflags, _hcd_intf);
> +}
> +EXPORT_SYMBOL_GPL(usb_otg_add_hcd);
> +
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
hcd->flags = 0;
> >
> > seems like this would make more sense in usb_del_hcd() instead.
> >
>
> OK, I'll move it there.
>
It depends on Alan's comments, whether only usb_add_hcd/usb_del_hcd
pair can be called repeat. If Alan acks it, I have no idea for it.
--
Best Regard
On Fri, Apr 15, 2016 at 02:00:46PM +0300, Roger Quadros wrote:
> On 15/04/16 12:25, Peter Chen wrote:
> > On Tue, Apr 05, 2016 at 05:05:12PM +0300, Roger Quadros wrote:
> >> + * usb_otg_register() - Register the OTG/dual-role device to OTG core
> >> + * @dev: OTG/
k)(struct work_struct *work);
> +};
> +
> extern const char *usb_otg_state_string(enum usb_otg_state state);
>
> +#if IS_ENABLED(CONFIG_USB_OTG)
> +struct usb_otg *usb_otg_register(struct device *dev,
> + struct usb_otg_config *config);
> +int usb_otg_unre
For some platforms, the vbus status doesn't be known by system at
device mode. So, there is no way to trigger pulling dp up. We add
a platform flag CI_HDRC_DP_ALWAYS_PULLUP to cover this situation.
With this flag set, the dp will be pulled up during the driver probe.
Signed-off-by: Peter Chen
FSM mode only.
Signed-off-by: Peter Chen <peter.c...@nxp.com>
cc: Sanchayan Maity <maitysancha...@gmail.com>
cc: ivan.iva...@linaro.org
---
drivers/usb/chipidea/ci.h| 5 +-
drivers/usb/chipidea/core.c | 43 ++--
drivers/usb/chipidea/debug.c | 6 +--
drivers/usb
Since we have added otg version and HNP polling support, update
related documentation.
Signed-off-by: Peter Chen <peter.c...@nxp.com>
---
Documentation/usb/chipidea.txt | 13 -
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/Documentation/usb/chipidea
On Fri, Apr 08, 2016 at 10:16:30AM +0300, Roger Quadros wrote:
> On 08/04/16 04:01, Peter Chen wrote:
> > On Thu, Apr 07, 2016 at 01:40:21PM +0300, Roger Quadros wrote:
> >> On 07/04/16 12:42, Peter Chen wrote:
> >>> On Wed, Apr 06, 2016 at 09:32:22AM +0300, Roger Qua
On Thu, Apr 07, 2016 at 01:40:21PM +0300, Roger Quadros wrote:
> On 07/04/16 12:42, Peter Chen wrote:
> > On Wed, Apr 06, 2016 at 09:32:22AM +0300, Roger Quadros wrote:
> >> On 06/04/16 09:09, Felipe Balbi wrote:
> >>>
> >>> Hi,
> >>>
> &g
xt time. Assume we are at gadget mode, we may not hope the vbus regulator
is still on which is for host only. So, this part may need to implement
by each user.
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
..
struct usb_ep *(*match_ep)(struct usb_gadget *,
+ /* get the charger type */
+ enum usb_charger_type (*get_charger_type)(struct usb_gadget *);
};
struct usb_charger {
...
+ /* user can get charger type by implementing this callback */
+ enum usb_charger_type (*get_charger_type)(struct usb_charger
*);
}
>
> $subject has a fragility, however: It's assuming that we should always
> call ->get_charger_type() before ->vbus_draw(), but that's a good
> default, I'd say.
>
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Apr 06, 2016 at 01:25:06PM +0300, Felipe Balbi wrote:
>
> Hi,
>
> Peter Chen <hzpeterc...@gmail.com> writes:
> > On Wed, Apr 06, 2016 at 11:05:26AM +0300, Felipe Balbi wrote:
> >> Peter Chen <hzpeterc...@gmail.com> writes:
> >> > On
On Wed, Apr 06, 2016 at 11:05:26AM +0300, Felipe Balbi wrote:
> Peter Chen <hzpeterc...@gmail.com> writes:
> > On Wed, Apr 06, 2016 at 10:38:23AM +0300, Felipe Balbi wrote:
> >> Peter Chen <hzpeterc...@gmail.com> writes:
> >> > On Fri, Apr 01, 2
On Wed, Apr 06, 2016 at 10:38:23AM +0300, Felipe Balbi wrote:
> Peter Chen <hzpeterc...@gmail.com> writes:
> > On Fri, Apr 01, 2016 at 03:21:49PM +0800, Baolin Wang wrote:
> > +
> >> +static struct attribute *usb_charger_attrs[] = {
> >> + _attr_sdp_curre
int
> +usb_charger_unregister_notify(struct usb_charger *uchger,
> + struct notifier_block *nb)
> +{
> + return 0;
> +}
> +
> +static inline int
> +usb_charger_set_cur_limit(struct usb_charger *uchger,
> + struct usb_charger_cur_limit *cur_limit_set)
> +{
> + return 0;
> +}
> +
> +static inline int
> +usb_charger_set_cur_limit_by_type(struct usb_charger *uchger,
> + enum usb_charger_type type,
> + unsigned int cur_limit)
> +{
> + return 0;
> +}
> +
> +static inline unsigned int
> +usb_charger_get_current(struct usb_charger *uchger)
> +{
> + return 0;
> +}
> +
> +static inline enum usb_charger_type
> +usb_charger_get_type(struct usb_charger *uchger)
> +{
> + return UNKNOWN_TYPE;
> +}
> +
> +static inline int usb_charger_detect_type(struct usb_charger *uchger)
> +{
> + return 0;
> +}
> +
> +static inline int
> +usb_charger_plug_by_gadget(struct usb_gadget *gadget, unsigned long state)
> +{
> + return 0;
> +}
> +
> +static inline void devm_usb_charger_unregister(struct device *dev,
> +struct usb_charger *uchger)
> +{
> +}
> +
> +static inline int devm_usb_charger_register(struct device *dev,
> + struct usb_charger *uchger)
> +{
> + return 0;
> +}
> +
> +static inline int usb_charger_init(struct usb_gadget *ugadget)
> +{
> + return 0;
> +}
> +
> +static inline int usb_charger_exit(struct usb_gadget *ugadget)
> +{
> + return 0;
> +}
> +#endif
> +
> +#endif /* __LINUX_USB_CHARGER_H__ */
> diff --git a/include/uapi/linux/usb/charger.h
> b/include/uapi/linux/usb/charger.h
> new file mode 100644
> index 000..3c56ec4
> --- /dev/null
> +++ b/include/uapi/linux/usb/charger.h
> @@ -0,0 +1,31 @@
> +/*
> + * This file defines the USB charger type and state that are needed for
> + * USB device APIs.
> + */
> +
> +#ifndef _UAPI__LINUX_USB_CHARGER_H
> +#define _UAPI__LINUX_USB_CHARGER_H
> +
> +/*
> + * USB charger type:
> + * SDP (Standard Downstream Port)
> + * DCP (Dedicated Charging Port)
> + * CDP (Charging Downstream Port)
> + * ACA (Accessory Charger Adapters)
> + */
> +enum usb_charger_type {
> + UNKNOWN_TYPE,
> + SDP_TYPE,
> + DCP_TYPE,
> + CDP_TYPE,
> + ACA_TYPE,
> +};
> +
> +/* USB charger state */
> +enum usb_charger_state {
> + USB_CHARGER_DEFAULT,
> + USB_CHARGER_PRESENT,
> + USB_CHARGER_REMOVE,
> +};
> +
> +#endif /* _UAPI__LINUX_USB_CHARGER_H */
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
d notify charger IC together at this
API together, it has already covered all situations. We don't need to
notify charger IC again when the gadget status has changed again.
> if (!gadget->ops->vbus_draw)
> return -EOPNOTSUPP;
> return gadget->ops->vbus_dr
On Tue, Apr 05, 2016 at 04:48:19PM +0300, Roger Quadros wrote:
> Peter,
>
> On 05/04/16 15:52, Roger Quadros wrote:
> > Peter,
> >
> > On 05/04/16 11:52, Peter Chen wrote:
> >> On Thu, Mar 31, 2016 at 12:41:19PM +0300, Roger Quadros wrote:
> >>> I
roller, it is the whole system), it can
supply more power after set configuration. See 1.4.13 from BC 1.2.
An SDP expects a downstream device with a good battery to draw less than
2.5mA average when unconnected or suspended, up to 100mA maximum when
connected and not configured and not suspended, and up t
On Tue, Apr 05, 2016 at 05:34:02PM +0800, Baolin Wang wrote:
> On 5 April 2016 at 16:12, Peter Chen <hzpeterc...@gmail.com> wrote:
> > On Tue, Apr 05, 2016 at 03:54:31PM +0800, Baolin Wang wrote:
> >> Hi Peter,
> >>
> >> On 5 April 2016 at 14:46
On Mon, Mar 14, 2016 at 6:42 PM, Peter Chen <hzpeterc...@gmail.com> wrote:
> On Sat, Mar 05, 2016 at 03:10:11PM +0100, Andrew Lunn wrote:
>> > So, would you like to accept the generic solution like below:
>> >
>> > - Create a generic power sequence driver,
..) do {} while (0)
> -#endif
> -
> -#ifdef VERBOSE
> -#define MPC_LOC printk("Current Location [%s]:[%d]\n", __FILE__, __LINE__)
> -#else
> -#define MPC_LOC do {} while (0)
> -#endif
> -
> #define PROTO_UNDEF (0)
> #define PROTO_HOST (1)
> #define PROTO_GADGET (2)
> @@ -211,6 +197,9 @@ struct otg_fsm {
> u8 *host_req_flag;
> struct delayed_work hnp_polling_work;
> bool state_changed;
> +
> + /* for debug prints */
> + struct device *dev;
> };
>
> struct otg_fsm_ops {
> --
> 2.5.0
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Apr 05, 2016 at 03:54:31PM +0800, Baolin Wang wrote:
> Hi Peter,
>
> On 5 April 2016 at 14:46, Peter Chen <hzpeterc...@gmail.com> wrote:
> >
> > We are thinking USB charger framework for Freescale i.mx SoC series,
> > since our internal framework is no
00644
> index 000..3c56ec4
> --- /dev/null
> +++ b/include/uapi/linux/usb/charger.h
> @@ -0,0 +1,31 @@
> +/*
> + * This file defines the USB charger type and state that are needed for
> + * USB device APIs.
> + */
> +
> +#ifndef _UAPI__LINUX_USB_CHARGER_H
> +#define _UAPI__LINUX_USB_CHARGER_H
> +
> +/*
> + * USB charger type:
> + * SDP (Standard Downstream Port)
> + * DCP (Dedicated Charging Port)
> + * CDP (Charging Downstream Port)
> + * ACA (Accessory Charger Adapters)
> + */
> +enum usb_charger_type {
> + UNKNOWN_TYPE,
> + SDP_TYPE,
> + DCP_TYPE,
> + CDP_TYPE,
> + ACA_TYPE,
> +};
> +
> +/* USB charger state */
> +enum usb_charger_state {
> + USB_CHARGER_DEFAULT,
> + USB_CHARGER_PRESENT,
> + USB_CHARGER_REMOVE,
> +};
> +
> +#endif /* _UAPI__LINUX_USB_CHARGER_H */
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
the charger type. But for CDP/SDP, you need to
notify charger IC after set configuration has finished, since
the host may still not be ready to give high current.
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message
On Wed, Mar 30, 2016 at 12:56:27PM +0300, Roger Quadros wrote:
> Hi,
>
> Add documentation for struct otg_fsm with some trivial cleanups.
> All patches have been Acked by otg-fsm maintainer (Peter Chen).
>
I will queue them, thanks.
--
Best Regards,
Peter Chen
--
To unsubscribe
On Wed, Mar 30, 2016 at 01:29:34PM +0300, Felipe Balbi wrote:
>
> Hi,
>
> Peter Chen <hzpeterc...@gmail.com> writes:
> > [ text/plain ]
> > On Wed, Mar 23, 2016 at 02:17:27PM -0400, Jaret Cantu wrote:
> >> On 03/23/2016 01:37 PM, Jaret Cantu wrote:
> &g
gt; gadget state to usb charger.
>
Ok, I see, it only changes current limit at function usb_gadget_vbus_draw
in your patch 2/4. Then, we need to make sure usb_charger_set_cur_limit_by_type
is called before calling usb_gadget_set_state(gadget, USB_STATE_CONFIGURED).
It seems you have not implemented usb_charger_p
>
> On 16-03-29 00:24:46, Peter Chen wrote:
> >
> > >
> > > On 2016-03-25 00:40, Peter Chen wrote:
> > > > On Tue, Mar 15, 2016 at 02:08:26PM +0530, Sanchayan Maity wrote:
> > > >> Hello Peter,
> > > >>
> > > &g
On Wed, Mar 30, 2016 at 03:07:49PM +0800, Baolin Wang wrote:
> On 30 March 2016 at 10:05, Peter Chen <hzpeterc...@gmail.com> wrote:
> > On Tue, Mar 29, 2016 at 10:23:14AM -0700, Mark Brown wrote:
> >> On Mon, Mar 28, 2016 at 03:13:51PM +0800, Peter Chen wrote:
> >>
On Tue, Mar 29, 2016 at 10:23:14AM -0700, Mark Brown wrote:
> On Mon, Mar 28, 2016 at 03:13:51PM +0800, Peter Chen wrote:
> > On Mon, Mar 28, 2016 at 02:51:40PM +0800, Baolin Wang wrote:
>
> > > > I am afraid I still not find the user (udc driver) for this framework,
>
On Tue, Mar 29, 2016 at 10:15:41PM +0300, Светослав Нейков wrote:
> //adding cc to linux-usb ml
>
> 2016-03-29 7:55 GMT+03:00 Peter Chen <hzpeterc...@gmail.com>:
> > Would you please try below patch to see if it works for you:
>
> With the patch applied the code
ternative power is
> provided.
> This is not a commercial project, I am using a hacked WR-703N router,
> so certification is not on the table.
>
Would you please try below patch to see if it works for you:
>From a1fe3d7c030168bfc41524158b46271cc0e9f9f3 Mon Sep 17 00:00:00 2001
From: Peter
>
> On 2016-03-25 00:40, Peter Chen wrote:
> > On Tue, Mar 15, 2016 at 02:08:26PM +0530, Sanchayan Maity wrote:
> >> Hello Peter,
> >>
> >> The existing usage of extcon in Chipidea driver relies on OTG
> >> registers. In case of SoC with dua
>
> On 28 March 2016 at 15:13, Peter Chen <hzpeterc...@gmail.com> wrote:
> > On Mon, Mar 28, 2016 at 02:51:40PM +0800, Baolin Wang wrote:
> >> On 25 March 2016 at 15:09, Peter Chen <hzpeterc...@gmail.com> wrote:
> >> > On Thu, Mar 24
On Mon, Mar 28, 2016 at 02:51:40PM +0800, Baolin Wang wrote:
> On 25 March 2016 at 15:09, Peter Chen <hzpeterc...@gmail.com> wrote:
> > On Thu, Mar 24, 2016 at 08:35:53PM +0800, Baolin Wang wrote:
> >> Currently the Linux kernel does not provide any standard integration of
For each platform devices which is created by device tree, the default
DMA mask is set by of_dma_configure when the device are created. So
delete the redundant code at driver.
Signed-off-by: Peter Chen <peter.c...@nxp.com>
---
drivers/usb/chipidea/ci_hdrc_imx.c |4
1 file chan
ack doesn't have the code to handle it. If your vendor
IP supports something like (SOF Received Interrupt Enable) interrupt
at USBINTR, you can use it to compute the SoF number.
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
ndle disconnection? And the USB
certification test will fail if dp is always on?
I will re-design it, and keep you on cc.
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> Hi,
>
> We're using Linux 3.14.60 and we'd like to use the Chipidea USB driver that
> comes with it.
> We enabled USB support as "built-in" (ie: not as kernel module):
>
> CONFIG_USB=y
> CONFIG_USB_EHCI_HCD=y
> CONFIG_USB_OHCI_HCD=y
> CONFIG_USB_STORAGE=y
> CONFIG_USB_CHIPIDEA=y
>
sure Vybrid is NOT OTG core? Afaik, it is uses the same
IP base with other Freescale SoCs, just the IP core is 2.40a.
When working at device mode, can you read vbus status through
OTGSC? And if there is an ID pin (input pin) for Vybrid? I mean
SoC, not the board.
--
Best Regards,
Peter Chen
--
To
eover there may be other potential users will use
> it in future.
>
I am afraid I still not find the user (udc driver) for this framework, I would
like to see how udc driver block the enumeration until the charger detection
has finished, or am I missing something?
--
Best Regards,
Peter Chen
--
e the device described in the DT.
>
Hi Bjorn,
After reading the DMA documentation Russell supplied and several related
DMA APIs, would you please try below patch on your ARM64 platform?
Since the core device has no device node at all, I don't know why
your patch can work, or am I missing something?
>From
(val);
> + }
> +
I have tested "tx-d-cal", but it seems incorrect according to the xls you
have provided, would you please check it again or am I wrong?
dts changes:
+ {
+ fsl,tx-d-cal = <109>;
+};
+
+ {
+ fsl,tx-d-cal = <106>;
+};
+
The phy1's tx-d-cal is 0x3, a
(MXS_PHY_TX_CAL45_MAX - MXS_PHY_TX_CAL45_MIN);
> + mxs_phy->tx_reg_mask |= GM_USBPHY_TX_TXCAL45DP(~0);
> + mxs_phy->tx_reg_set |= GM_USBPHY_TX_TXCAL45DP(val);
> + }
> +
> + if (!of_property_read_u32(np, "fsl,tx-d-cal", ) &&
good practice is using dev_of_node for all devices in
case the struct device is not zero-initialized.
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
ta...@gmail.com>
> > ---
> > Applicable to linux-next-20160317
> >
> > Changes to v1:
> > - Initialize raw_port with port1
>
> Acked-by: Alan Stern <st...@rowland.harvard.edu>
>
Thanks for fixing it in time, you are right. My patch would let the
devi
On Thu, Mar 17, 2016 at 04:52:55PM +0100, Arnd Bergmann wrote:
> On Monday 14 March 2016 18:51:08 Peter Chen wrote:
> > On Wed, Mar 09, 2016 at 05:16:50PM -0600, Li Yang wrote:
> > > On Tue, Mar 8, 2016 at 9:40 PM, Bjorn Andersson
> > > <bjorn.anders...@linaro.org
gt; > that can called by the platform specific pieces. That way we will have
> > the chipidea core be the device described in the DT.
>
> But like I said, this problem is not just existing for chipidea
> driver. We already found that the dwc3 driver is also suffering from
&
ver gpio-en, gpio-rst, clock,
clock-freq, etc, but I find the pwrseq_emmc does something special, like
request a restart handler.
Add Ulf, who is the power sequence author for MMC.
Hi Ulf, Rob suggested that if we can create some generic things (driver
or library) for power sequence for all d
On Fri, Mar 04, 2016 at 10:28:54PM -0600, Rob Herring wrote:
> On Fri, Mar 04, 2016 at 10:37:50AM +0800, Peter Chen wrote:
> > On Fri, Mar 04, 2016 at 03:23:05AM +0100, Andrew Lunn wrote:
> > > On Fri, Mar 04, 2016 at 10:02:42AM +0800, Peter Chen wrote:
> > > > On T
>
> [] (process_one_work) from [] (worker_thread+0x2d0/0x424)
>
> r10: r9:ee0aa518 r8:eedd3260 r7:c06e6100 r6:eedd3240 r5:eedd3240
>
&g
_CTRL_CLR);
> writel(0, x->io_priv + HW_USBPHY_PWD);
> +
> + mxs_phy_tx_init(mxs_phy);
Afaik, the register content will not be changed during PHY
suspend/resume operation.
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Mar 04, 2016 at 03:23:05AM +0100, Andrew Lunn wrote:
> On Fri, Mar 04, 2016 at 10:02:42AM +0800, Peter Chen wrote:
> > On Thu, Mar 03, 2016 at 02:54:55PM -0600, Rob Herring wrote:
> > > On Thu, Mar 3, 2016 at 4:01 AM, Peter Chen <peter.c...@nxp.com> wrote:
>
> > USB code will not touch its glue layer device (controller's parent).
>
> I'm just thinking about code like:
>
> of_find_spi_master_by_node(), of_find_net_device_by_node(),
> of_find_backlight_by_node(), etc.
>
> If somebody was to implement an of_find_usb_host_by_node() are you
> 100% sure the right node will be found? This seems like a bug waiting
> to happen.
Yes, almost 100% sure it is ok since the common USB code will never use
its root's parent node to match or get something.
--
Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Mar 03, 2016 at 01:31:56PM -0500, Alan Stern wrote:
> On Thu, 3 Mar 2016, Peter Chen wrote:
>
> > Some hard-wired USB devices need to do power sequence to let the
> > device work normally, the typical power sequence like: enable USB
> > PHY clock, toggle reset pin
On Thu, Mar 03, 2016 at 11:30:53PM +0100, Maciej S. Szmigiero wrote:
> Hi Peter,
>
> On 03.03.2016 11:01, Peter Chen wrote:
> > From: Peter Chen <peter.c...@freescale.com>
> >
> > The current dts describes USB HUB's property at USB controller's
> > en
On Thu, Mar 03, 2016 at 02:54:55PM -0600, Rob Herring wrote:
> On Thu, Mar 3, 2016 at 4:01 AM, Peter Chen <peter.c...@nxp.com> wrote:
> > Some hard-wired USB devices need to do power sequence to let the
> > device work normally, the typical power sequence like: enable USB
On Thu, Mar 03, 2016 at 03:42:47PM +0100, Andrew Lunn wrote:
> On Thu, Mar 03, 2016 at 06:01:15PM +0800, Peter Chen wrote:
> > From: Peter Chen <peter.c...@freescale.com>
> >
> > Since the hcd (chipidea core device) has no device node, so
> > if we want to desc
.net/lists/linux-usb/msg136698.html
Peter Chen (3):
usb: core: add power sequence for USB devices
usb: chipidea: host: let the hcd know's parent device node
ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property
.../devicetree/bindings/usb/usb-device.txt | 41 +-
arch/arm/boot/d
be recognized by controller at all.
In this patch, it will do power on sequence at hub's probe for all
devices under this hub (includes root hub) if this device is described
at dts and there is a phandle "usb-pwrseq" for it. At hub_disconnect,
it will do power off sequence.
Signed-off-by:
From: Peter Chen <peter.c...@freescale.com>
Since the hcd (chipidea core device) has no device node, so
if we want to describe the child node under the hcd, we had
to put it under its parent's node (glue layer device), and
in the code, we need to let the hcd knows glue layer's code,
then t
From: Peter Chen <peter.c...@freescale.com>
The current dts describes USB HUB's property at USB controller's
entry, it is improper. The USB HUB should be the child node
under USB controller.
Signed-off-by: Peter Chen <peter.c...@freescale.com>
---
arch/arm/boot/dts/imx6qdl-ud
):
usb: chipidea: udc: remove unused value assignment
Peter Chen (3):
usb: chipidea: add system interface for ttctrl.ttha
doc: usb: ci-hdrc-usb2: add property non-zero-ttctrl-ttha
Revert "usb: chipidea: imx: enable CI_HDRC_SET_NON_ZERO_TTHA"
Stefan Agner (1):
usb
wakeup, this bug is existed once this driver
has written.
Peter Chen (1):
usb: chipidea: otg: change workqueue ci_otg as freezable
drivers/usb/chipidea/otg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
Best
>
> Hi,
>
> I'm wondering if you plan to include the "USB: core: let USB device know
> device
> node" change in 4.6? I didn't see it hit the next tree yet and I'd like to
> submit
> patches that would need it (MAC address for USB ethernet for Raspberry Pi).
>
I have already submitted it,
On Thu, Feb 25, 2016 at 05:01:12PM -0500, Tejun Heo wrote:
> Hello, Peter.
>
> On Wed, Feb 24, 2016 at 03:24:30PM +0800, Peter Chen wrote:
> > > You might want to complain to the block-layer people about this. I
> > > don't know if anything can be done to fi
On Thu, Feb 25, 2016 at 02:08:44PM -0300, Fabio Estevam wrote:
> On Wed, Feb 24, 2016 at 10:20 PM, Peter Chen <hzpeterc...@gmail.com> wrote:
>
> > Would you get any chances to test i.mx28 evk with an external HUB?
> > I just would like to know it is not a HUB issue whic
get any chances to test i.mx28 evk with an external HUB?
I just would like to know it is not a HUB issue which can't be
suspended.
Currently, with chipidea/mxs phy runtime suspend disable for imx23/28
will keep the PHY is active, and related clock is on; And USB core
is runtime suspend enabled
On Thu, Jan 07, 2016 at 08:18:02AM -0600, Rob Herring wrote:
> On Tue, Jan 5, 2016 at 9:20 PM, Peter Chen <hzpeterc...@gmail.com> wrote:
> > On Tue, Jan 05, 2016 at 08:36:31AM -0600, Rob Herring wrote:
> >> > 2. There are MFD USB devices, which includes several interfa
On Tue, Feb 23, 2016 at 10:34:09AM -0500, Alan Stern wrote:
> On Tue, 23 Feb 2016, Peter Chen wrote:
>
> > Hi Tejun Heo and Florian Mickler,
> >
> > I have a question that during the system resume process, the freezable
> > workqueue can be thawed if ther
usb_disconnect+0x48/0x224
[ 555.748179] #5: (>mutex){..}, at: []
device_release_driver+0x20/0x34
[ 555.756487] #6: (>scan_mutex){+.+.+.}, at: []
scsi_remove_host+0x20/0x104
Cc: <sta...@vger.kernel.org> #v3.14+
Cc: Jun Li <jun...@nxp.com>
Signed-off-by: Peter Chen <peter.c...@nxp.com>
---
drivers
> On Tue, Feb 23, 2016 at 10:20 PM, Peter Chen <hzpeterc...@gmail.com>
> wrote:
>
> > Oh, you said it is called before.
> >
> > http://www.spinics.net/lists/linux-usb/msg136714.html
>
> Yes, I have enabled runtime pm previously. Sorry for the confusi
On Tue, Feb 23, 2016 at 05:06:12PM -0300, Fabio Estevam wrote:
> On Tue, Feb 23, 2016 at 4:47 PM, Fabio Estevam <feste...@gmail.com> wrote:
> > Hi Peter,
> >
> > On Sun, Feb 21, 2016 at 10:59 PM, Peter Chen <hzpeterc...@gmail.com> wrote:
> >
> >> Fa
901 - 1000 of 3537 matches
Mail list logo