lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1444228816-4497-1-git-send-email-ralyautdin@dev.rtsoft.ru>
Date:	Wed,  7 Oct 2015 17:40:16 +0300
From:	Roman Alyautdin <ralyautdin@....rtsoft.ru>
To:	balbi@...com
Cc:	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	sergei.shtylyov@...entembedded.com,
	Roman Alyautdin <ralyautdin@....rtsoft.ru>
Subject: [PATCH] usb: musb: dsps: implement vbus_status method

Implement vbus_status  method of musb_platform_ops that allows
musb_core to properly represent the VBUS status of musb_dsps devices in
corresponding sysfs entry

Signed-off-by: Roman Alyautdin <ralyautdin@....rtsoft.ru>
---
 drivers/usb/musb/musb_dsps.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 84512d1..9c00edf 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -632,6 +632,18 @@ static void dsps_read_fifo32(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 	}
 }
 
+static int dsps_musb_vbus_status(struct musb *musb)
+{
+	void __iomem *mregs = musb->mregs;
+	u8 devctl;
+
+	devctl = dsps_readb(mregs, MUSB_DEVCTL);
+	if ((devctl & MUSB_DEVCTL_VBUS) == (3 << MUSB_DEVCTL_VBUS_SHIFT))
+		return 1;
+	else
+		return 0;
+}
+
 static struct musb_platform_ops dsps_ops = {
 	.quirks		= MUSB_DMA_CPPI41 | MUSB_INDEXED_EP,
 	.init		= dsps_musb_init,
@@ -647,6 +659,7 @@ static struct musb_platform_ops dsps_ops = {
 	.try_idle	= dsps_musb_try_idle,
 	.set_mode	= dsps_musb_set_mode,
 	.recover	= dsps_musb_recover,
+	.vbus_status	= dsps_musb_vbus_status,
 };
 
 static u64 musb_dmamask = DMA_BIT_MASK(32);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ