From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Shiyan <shc_work@mail.ru>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/6] Rename definitions for ULPI registers
Date: Mon, 2 Apr 2012 09:35:17 +0200 [thread overview]
Message-ID: <20120402073517.GB3852@pengutronix.de> (raw)
In-Reply-To: <1332597640-31268-1-git-send-email-shc_work@mail.ru>
On Sat, Mar 24, 2012 at 06:00:35PM +0400, Alexander Shiyan wrote:
> These registers can be used for any standart ULPI chip,
> not only for ISP1504.
>
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Applied, thanks
Sascha
> ---
> drivers/usb/otg/isp1504.c | 14 +++++++-------
> drivers/usb/otg/ulpi.c | 4 ++--
> include/usb/ulpi.h | 20 ++++++++++----------
> 3 files changed, 19 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/usb/otg/isp1504.c b/drivers/usb/otg/isp1504.c
> index 9ba74b1..9884df4 100644
> --- a/drivers/usb/otg/isp1504.c
> +++ b/drivers/usb/otg/isp1504.c
> @@ -6,10 +6,10 @@ int isp1504_set_vbus_power(void __iomem *view, int on)
> {
> int vid, pid, ret = 0;
>
> - vid = (ulpi_read(ISP1504_VID_HIGH, view) << 8) |
> - ulpi_read(ISP1504_VID_LOW, view);
> - pid = (ulpi_read(ISP1504_PID_HIGH, view) << 8) |
> - ulpi_read(ISP1504_PID_LOW, view);
> + vid = (ulpi_read(ULPI_VID_HIGH, view) << 8) |
> + ulpi_read(ULPI_VID_LOW, view);
> + pid = (ulpi_read(ULPI_PID_HIGH, view) << 8) |
> + ulpi_read(ULPI_PID_LOW, view);
>
> pr_info("ULPI Vendor ID 0x%x Product ID 0x%x\n", vid, pid);
> if (vid != 0x4cc || pid != 0x1504) {
> @@ -22,15 +22,15 @@ int isp1504_set_vbus_power(void __iomem *view, int on)
> DRV_VBUS | /* enable internal Vbus */
> USE_EXT_VBUS_IND | /* use external indicator */
> CHRG_VBUS, /* charge Vbus */
> - ISP1504_OTGCTL, view);
> + ULPI_OTGCTL, view);
> } else {
> ret = ulpi_clear(DRV_VBUS_EXT | /* disable external Vbus */
> DRV_VBUS, /* disable internal Vbus */
> - ISP1504_OTGCTL, view);
> + ULPI_OTGCTL, view);
>
> ret |= ulpi_set(USE_EXT_VBUS_IND | /* use external indicator */
> DISCHRG_VBUS, /* discharge Vbus */
> - ISP1504_OTGCTL, view);
> + ULPI_OTGCTL, view);
> }
>
> return ret;
> diff --git a/drivers/usb/otg/ulpi.c b/drivers/usb/otg/ulpi.c
> index 6ed6f01..575ed94 100644
> --- a/drivers/usb/otg/ulpi.c
> +++ b/drivers/usb/otg/ulpi.c
> @@ -87,7 +87,7 @@ int ulpi_set(u8 bits, int reg, void __iomem *view)
> }
>
> writel((ULPIVW_RUN | ULPIVW_WRITE |
> - ((reg + ISP1504_REG_SET) << ULPIVW_ADDR_SHIFT) |
> + ((reg + ULPI_REG_SET) << ULPIVW_ADDR_SHIFT) |
> ((bits & ULPIVW_WDATA_MASK) << ULPIVW_WDATA_SHIFT)),
> view);
>
> @@ -104,7 +104,7 @@ int ulpi_clear(u8 bits, int reg, void __iomem *view)
> int ret;
>
> writel((ULPIVW_RUN | ULPIVW_WRITE |
> - ((reg + ISP1504_REG_CLEAR) << ULPIVW_ADDR_SHIFT) |
> + ((reg + ULPI_REG_CLEAR) << ULPIVW_ADDR_SHIFT) |
> ((bits & ULPIVW_WDATA_MASK) << ULPIVW_WDATA_SHIFT)),
> view);
>
> diff --git a/include/usb/ulpi.h b/include/usb/ulpi.h
> index 0397fdb..9eed6a4 100644
> --- a/include/usb/ulpi.h
> +++ b/include/usb/ulpi.h
> @@ -5,19 +5,19 @@ int ulpi_set(u8 bits, int reg, void __iomem *view);
> int ulpi_clear(u8 bits, int reg, void __iomem *view);
> int ulpi_read(int reg, void __iomem *view);
>
> -/* ISP 1504 register addresses */
> -#define ISP1504_VID_LOW 0x00 /* Vendor ID low */
> -#define ISP1504_VID_HIGH 0x01 /* Vendor ID high */
> -#define ISP1504_PID_LOW 0x02 /* Product ID low */
> -#define ISP1504_PID_HIGH 0x03 /* Product ID high */
> -#define ISP1504_ITFCTL 0x07 /* Interface Control */
> -#define ISP1504_OTGCTL 0x0A /* OTG Control */
> +/* ULPI register addresses */
> +#define ULPI_VID_LOW 0x00 /* Vendor ID low */
> +#define ULPI_VID_HIGH 0x01 /* Vendor ID high */
> +#define ULPI_PID_LOW 0x02 /* Product ID low */
> +#define ULPI_PID_HIGH 0x03 /* Product ID high */
> +#define ULPI_ITFCTL 0x07 /* Interface Control */
> +#define ULPI_OTGCTL 0x0A /* OTG Control */
>
> /* add to above register address to access Set/Clear functions */
> -#define ISP1504_REG_SET 0x01
> -#define ISP1504_REG_CLEAR 0x02
> +#define ULPI_REG_SET 0x01
> +#define ULPI_REG_CLEAR 0x02
>
> -/* 1504 OTG Control Register bits */
> +/* ULPI OTG Control Register bits */
> #define USE_EXT_VBUS_IND (1 << 7) /* Use ext. Vbus indicator */
> #define DRV_VBUS_EXT (1 << 6) /* Drive Vbus external */
> #define DRV_VBUS (1 << 5) /* Drive Vbus */
> --
> 1.7.3.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2012-04-02 7:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-24 14:00 Alexander Shiyan
2012-03-24 14:00 ` [PATCH 2/6] Add ULPI detection function Alexander Shiyan
2012-03-24 14:00 ` [PATCH 3/6] Move set_vbus_power code to ULPI driver Alexander Shiyan
2012-03-24 14:00 ` [PATCH 4/6] Rename function ulpi_init to ulpi_detect Alexander Shiyan
2012-03-24 14:00 ` [PATCH 5/6] Completely migrate option ISP1504 to ULPI Alexander Shiyan
2012-03-24 14:00 ` [PATCH 6/6] Cosmetic change name ISP1504 -> ISP150x Alexander Shiyan
2012-04-02 7:35 ` Sascha Hauer [this message]
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=20120402073517.GB3852@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=shc_work@mail.ru \
/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