From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932199AbdJWVzS (ORCPT ); Mon, 23 Oct 2017 17:55:18 -0400 Received: from mail2.skidata.com ([91.230.2.91]:31174 "EHLO mail2.skidata.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751791AbdJWVzQ (ORCPT ); Mon, 23 Oct 2017 17:55:16 -0400 X-IronPort-AV: E=Sophos;i="5.43,424,1503352800"; d="scan'208";a="1059669" Subject: Re: [PATCH 09/10 v3] usb: usb251xb: Add max power/current dts property support To: Serge Semin , , , CC: , , , , Richard Leitner References: <20170916104220.3742-1-fancer.lancer@gmail.com> <20171022203812.9379-1-fancer.lancer@gmail.com> <20171022203812.9379-10-fancer.lancer@gmail.com> From: Richard Leitner Message-ID: Date: Mon, 23 Oct 2017 23:55:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171022203812.9379-10-fancer.lancer@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: de-AT Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.24.97] X-ClientProxiedBy: sdex1srv.skidata.net (172.16.10.92) To sdex2srv.skidata.net (172.16.10.93) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, again some nit-picks below... On 10/22/2017 10:38 PM, Serge Semin wrote: > This parameters may be varied in accordance with hardware specifics. > So lets add the corresponding settings to the usb251xb driver dts > specification. > > Signed-off-by: Serge Semin > --- > drivers/usb/misc/usb251xb.c | 24 ++++++++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c > index 29432fd3b..669b98be2 100644 > --- a/drivers/usb/misc/usb251xb.c > +++ b/drivers/usb/misc/usb251xb.c > @@ -500,6 +500,26 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, > } > } > > + hub->max_power_sp = USB251XB_DEF_MAX_POWER_SELF; > + if (!of_property_read_u32(np, "sp-max-total-current-microamp", > + &property_u32)) Please match the "correct" (of_property_read_u32) opening parenthesis here... > + hub->max_power_sp = min_t(u8, property_u32 / 2000, 50); > + > + hub->max_power_bp = USB251XB_DEF_MAX_POWER_BUS; > + if (!of_property_read_u32(np, "bp-max-total-current-microamp", > + &property_u32)) ... and here ... > + hub->max_power_bp = min_t(u8, property_u32 / 2000, 255); > + > + hub->max_current_sp = USB251XB_DEF_MAX_CURRENT_SELF; > + if (!of_property_read_u32(np, "sp-max-removable-current-microamp", > + &property_u32)) ... and here ... > + hub->max_current_sp = min_t(u8, property_u32 / 2000, 50); > + > + hub->max_current_bp = USB251XB_DEF_MAX_CURRENT_BUS; > + if (!of_property_read_u32(np, "bp-max-removable-current-microamp", > + &property_u32)) ... and here ... > + hub->max_current_bp = min_t(u8, property_u32 / 2000, 255); > + > hub->power_on_time = USB251XB_DEF_POWER_ON_TIME; > if (!of_property_read_u32(np, "power-on-time-ms", &property_u32)) > hub->power_on_time = min_t(u8, property_u32 / 2, 255); Thanks! kind regards, Richard.L