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: <20220125214245.GA4196@tom-ThinkPad-T470p>
Date:   Tue, 25 Jan 2022 22:42:45 +0100
From:   Tommaso Merciai <tomm.merciai@...il.com>
To:     Richard Leitner - SKIDATA <Richard.Leitner@...data.com>
Cc:     "linuxfancy@...glegroups.com" <linuxfancy@...glegroups.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "richard.leitner@...ux.dev" <richard.leitner@...ux.dev>
Subject: Re: [PATCH] usb: usb251xb: add boost-up property support

On Mon, Jan 24, 2022 at 07:03:57AM +0000, Richard Leitner - SKIDATA wrote:
> Hi Tommaso,
> 
> thanks for implementing the boost up register.
> 
> On Sat, Jan 22, 2022 at 12:26:12AM +0100, Tommaso Merciai wrote:
> > Add u8 property to support boost-up register of usb251xb hub.
> > boost-up property control USB electrical drive strenght
> > This register can be set:
> > 
> >  - Normal mode -> 0x00
> >  - Low         -> 0x01
> >  - Medium      -> 0x10
> >  - High        -> 0x11
> > 
> > (Normal Default)
> > 
> > References:
> >  - http://www.mouser.com/catalog/specsheets/2514.pdf p29
> > 
> > Signed-off-by: Tommaso Merciai <tomm.merciai@...il.com>
> > ---
> >  drivers/usb/misc/usb251xb.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c
> > index 507deef1f709..74fd8ac0c303 100644
> > --- a/drivers/usb/misc/usb251xb.c
> > +++ b/drivers/usb/misc/usb251xb.c
> > @@ -402,6 +402,7 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,
> >  	struct device_node *np = dev->of_node;
> >  	int len, err;
> >  	u32 property_u32 = 0;
> > +	u8 property_u8 = 0;
> >  	const char *cproperty_char;
> >  	char str[USB251XB_STRING_BUFSIZE / 2];
> >  
> > @@ -543,6 +544,12 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,
> >  	if (of_property_read_u16_array(np, "language-id", &hub->lang_id, 1))
> >  		hub->lang_id = USB251XB_DEF_LANGUAGE_ID;
> >  
> > +	if (!of_property_read_u8(np, "boost-up", &property_u8)){
> > +		hub->boost_up = property_u8;
> 
> IMHO we don't need the property_u8 var here as you could pass
> &hub->boost_up directly to of_property_read_u8() ?

Hi Richard,
Thanks for your reply. You mean like:

if (!of_property_read_u8(np, "boost-up", &hub->boost_up))

Let me know. I'll fix that in v2.

Thanks,
Tommaso
> 
> regards;rl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ