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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c02407b4-1825-83f5-2aff-dd41ae16e2ab@huawei.com>
Date:   Tue, 19 Feb 2019 11:20:07 +0800
From:   Chen Yu <chenyu56@...wei.com>
To:     Chunfeng Yun <chunfeng.yun@...iatek.com>
CC:     <liuyu712@...ilicon.com>, <linux-usb@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <john.stultz@...aro.org>, <suzhuangluan@...ilicon.com>,
        <kongfei@...ilicon.com>, <wanghu17@...ilicon.com>,
        <butao@...ilicon.com>, <chenyao11@...wei.com>,
        <fangshengzhou@...ilicon.com>, <lipengcheng8@...wei.com>,
        <songxiaowei@...ilicon.com>, <xuyiping@...ilicon.com>,
        <xuyoujun4@...wei.com>, <yudongbin@...ilicon.com>,
        <zangleigang@...ilicon.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Binghui Wang <wangbinghui@...ilicon.com>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Subject: Re: [PATCH v2 08/10] hikey960: Support usb functionality of Hikey960

Hi,

On 2019/2/19 10:50, Chunfeng Yun wrote:
>> +	if (ret)
>> +		hisi_hikey_usb->typec_vbus_enable_val = 1;
>> +
>> +	hisi_hikey_usb->typec_vbus = devm_gpiod_get(dev, "typec-vbus",
>> +			hisi_hikey_usb->typec_vbus_enable_val ?
>> +			GPIOD_OUT_LOW : GPIOD_OUT_HIGH);
>> +	if (!hisi_hikey_usb->typec_vbus)
>> +		return -ENOENT;
>> +	else if (IS_ERR(hisi_hikey_usb->typec_vbus))
>> +		return PTR_ERR(hisi_hikey_usb->typec_vbus);
>> +
>> +	gpiod_direction_output(hisi_hikey_usb->typec_vbus,
>> +			!hisi_hikey_usb->typec_vbus_enable_val);
> maybe a simple way if use fixed regulator?
> 
The hardware of the Hikey960 board has been fixed, and the type-c
port can act as UFP. So it is better to close the vbus when Hikey960
connect to host(e.g PC).
>> +
>> +	hisi_hikey_usb->otg_switch = devm_gpiod_get(dev, "otg-switch", GPIOD_IN);
>> +	if (!hisi_hikey_usb->otg_switch)
>> +		return -ENOENT;
>> +	else if (IS_ERR(hisi_hikey_usb->otg_switch))
>> +		return PTR_ERR(hisi_hikey_usb->otg_switch);
>> +
>> +	gpiod_direction_output(hisi_hikey_usb->otg_switch, USB_SWITCH_TO_HUB);
>> +
>> +	/* hub-vdd33-en is optional */
>> +	hisi_hikey_usb->hub_vbus = devm_gpiod_get(dev, "hub-vdd33-en",
>> +			GPIOD_OUT_LOW);
>> +	if (IS_ERR(hisi_hikey_usb->hub_vbus))
>> +		return PTR_ERR(hisi_hikey_usb->hub_vbus);
>> +
>> +	gpiod_direction_output(hisi_hikey_usb->hub_vbus, HUB_VBUS_POWER_ON);
> ditto
>> +
>> +	hisi_hikey_usb->role_sw = usb_role_switch_get(dev);
>> +	if (!hisi_hikey_usb->role_sw)
>> +		return -EPROBE_DEFER;
>> +	else if (IS_ERR(hisi_hikey_usb->role_sw))
>> +		return PTR_ERR(hisi_hikey_usb->role_sw);
>> +

Thanks
Yu Chen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ