All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minkyu Kang <mk7.kang@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] trats: usb: Add usb_cable_connected() function
Date: Mon, 02 Dec 2013 11:26:30 +0900	[thread overview]
Message-ID: <529BEFD6.9040002@samsung.com> (raw)
In-Reply-To: <1384340046-31956-1-git-send-email-p.marczak@samsung.com>

Dear Przemyslaw Marczak,

On 13/11/13 19:54, Przemyslaw Marczak wrote:
> Changes:
> - define function usb_cable_connected() in trats board file
>   which returns 1 if cable is connected and 0 otherwise
> - trats.h: add CONFIG_USB_CHECK_CABLE
> 
> Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> ---
>  board/samsung/trats/trats.c |   10 ++++++++++
>  include/configs/trats.h     |    1 +
>  2 files changed, 11 insertions(+)
> 
> diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
> index 7f61d17..9ed70d3 100644
> --- a/board/samsung/trats/trats.c
> +++ b/board/samsung/trats/trats.c
> @@ -500,6 +500,16 @@ void board_usb_init(void)
>  	debug("USB_udc_probe\n");
>  	s3c_udc_probe(&s5pc210_otg_data);
>  }
> +
> +#ifdef CONFIG_USB_CABLE_CHECK
> +int usb_cable_connected(void)
> +{
> +	struct pmic *muic = pmic_get("MAX8997_MUIC");

Please check that muic is available.

> +	int cable_connected = muic->chrg->chrg_type(muic);
> +
> +	return !!cable_connected;

I think, cable_connected is unnecessary.

return !!muic->chrg->chrg_type(muic);

> +}
> +#endif
>  #endif
>  
>  static void pmic_reset(void)
> diff --git a/include/configs/trats.h b/include/configs/trats.h
> index 24ea06b..7f8009e 100644
> --- a/include/configs/trats.h
> +++ b/include/configs/trats.h
> @@ -300,6 +300,7 @@
>  #define CONFIG_USB_GADGET_S3C_UDC_OTG
>  #define CONFIG_USB_GADGET_DUALSPEED
>  #define CONFIG_USB_GADGET_VBUS_DRAW	2
> +#define CONFIG_USB_CABLE_CHECK
>  
>  /* LCD */
>  #define CONFIG_EXYNOS_FB
> 

Thanks,
Minkyu Kang.

  parent reply	other threads:[~2013-12-02  2:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 10:54 [U-Boot] [PATCH] trats: usb: Add usb_cable_connected() function Przemyslaw Marczak
2013-11-28  9:16 ` Przemyslaw Marczak
2013-12-02  2:26 ` Minkyu Kang [this message]
2013-12-02 12:54 ` [U-Boot] [PATCH v2] " Przemyslaw Marczak
2013-12-03  0:35   ` Minkyu Kang
2013-12-03 10:38     ` Przemyslaw Marczak

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=529BEFD6.9040002@samsung.com \
    --to=mk7.kang@samsung.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.