{"id":814490,"url":"http://patchwork.ozlabs.org/api/patches/814490/?format=json","web_url":"http://patchwork.ozlabs.org/project/devicetree-bindings/patch/20170916104220.3742-9-fancer.lancer@gmail.com/","project":{"id":37,"url":"http://patchwork.ozlabs.org/api/projects/37/?format=json","name":"Devicetree Bindings","link_name":"devicetree-bindings","list_id":"devicetree.vger.kernel.org","list_email":"devicetree@vger.kernel.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170916104220.3742-9-fancer.lancer@gmail.com>","list_archive_url":null,"date":"2017-09-16T10:42:19","name":"[8/9,v2] usb: usb251xb: Add max power/current dts property support","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":true,"hash":"d48aa694939b1bb49c9f9c21be924e7f372c472c","submitter":{"id":70038,"url":"http://patchwork.ozlabs.org/api/people/70038/?format=json","name":"Serge Semin","email":"fancer.lancer@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/devicetree-bindings/patch/20170916104220.3742-9-fancer.lancer@gmail.com/mbox/","series":[{"id":3430,"url":"http://patchwork.ozlabs.org/api/series/3430/?format=json","web_url":"http://patchwork.ozlabs.org/project/devicetree-bindings/list/?series=3430","date":"2017-09-16T10:42:11","name":"usb: usb251xb: Add USB2517i hub support and fix some bugs","version":2,"mbox":"http://patchwork.ozlabs.org/series/3430/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/814490/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/814490/checks/","tags":{},"related":[],"headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"pL3LCnLM\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xvTPF5cNgz9t2c\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tSat, 16 Sep 2017 20:42:41 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751433AbdIPKmi (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tSat, 16 Sep 2017 06:42:38 -0400","from mail-lf0-f68.google.com ([209.85.215.68]:32870 \"EHLO\n\tmail-lf0-f68.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751231AbdIPKmc (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Sat, 16 Sep 2017 06:42:32 -0400","by mail-lf0-f68.google.com with SMTP id y15so2337064lfd.0;\n\tSat, 16 Sep 2017 03:42:31 -0700 (PDT)","from linux.local ([95.79.181.62]) by smtp.gmail.com with ESMTPSA id\n\tf199sm553379lfg.85.2017.09.16.03.42.29\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tSat, 16 Sep 2017 03:42:30 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=ZGR4TmMZsov/01mvNv9ErAjcNuXapDYWNVKYfATROAs=;\n\tb=pL3LCnLMEbVjOUBCPwyK/vEjB6P6Ut6ZCRKtDibAAC4REx6/U3QVpTYZf9K9falHky\n\tIyZ0uLkFraHB6yo24CK2LyKo3bpW7spsI8MeGR2RRJr3dRzVtvEsvnUicV/ffBjuryUl\n\tjb85iYCREH2JULM7SSKj7fXAp+KQi7GW0A/cXl1jp8kpKpB1WpBL9q9BosgJm18iRwbW\n\t4niaMZTRrG9kPkhM3k621XAfqsd4BVCD0j+ItGskw+3JagflJpAgUN/Elq0CABdVp444\n\tKByIMMeGxIIfokLlG+g17lFUL2gdzvE0WldUZMCf1uSOabX5Oo84J6G+i9IegtKfGqzj\n\tTD6w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=ZGR4TmMZsov/01mvNv9ErAjcNuXapDYWNVKYfATROAs=;\n\tb=Co22NT2mkIM6LZwtmLa9lPC9Acs7aAhFId0KH3gfb5v5QMLZUEBBbtxJfwlsmt8ZT2\n\tQN88+U+CoRHgz0kwclmq5D6c5VQryiwx+/Su+gHx1yZkCDiBQSNWiQwfovBUMFavS4Zm\n\tdYJUkgmlV7PXCNJbZNGyfaT73izO4PPUptPEPuJkvnMgmISlBzOFH4SmxULW+VOc4TQo\n\tY2g2UJ/sJoOQEeosyyjeP7ei24dnQEsXYmnNoAvhWk1ykBLGZe3wxY23PEB7YoSRdujf\n\trgtpKXbRpzkY6j5ufTxGNnQWiIKf8SZgGiAkJ6G+WikdUOXhFXJBLoDyqyt3MzdUpsym\n\tmcaw==","X-Gm-Message-State":"AHPjjUgtK1kzcQhaKz1BwvDAS0rmFomE6OA0SnnxUeXByUsextnzhJJ8\n\txWyWh0c8lPleOAvOxyQ=","X-Google-Smtp-Source":"AOwi7QBub2/fvGK1vFHNbOL5mXBMYzy3Gm/QCLO3w1as6Uj8TddzxKepWwChKmZSSixZbNN66yVrKA==","X-Received":"by 10.46.70.9 with SMTP id t9mr9038061lja.54.1505558550815;\n\tSat, 16 Sep 2017 03:42:30 -0700 (PDT)","From":"Serge Semin <fancer.lancer@gmail.com>","To":"richard.leitner@skidata.com, gregkh@linuxfoundation.org,\n\trobh+dt@kernel.org, mark.rutland@arm.com","Cc":"Sergey.Semin@t-platforms.ru, linux-usb@vger.kernel.org,\n\tdevicetree@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tSerge Semin <fancer.lancer@gmail.com>","Subject":"[PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property\n\tsupport","Date":"Sat, 16 Sep 2017 13:42:19 +0300","Message-Id":"<20170916104220.3742-9-fancer.lancer@gmail.com>","X-Mailer":"git-send-email 2.12.0","In-Reply-To":"<20170916104220.3742-1-fancer.lancer@gmail.com>","References":"<20170915233113.17855-1-fancer.lancer@gmail.com>\n\t<20170916104220.3742-1-fancer.lancer@gmail.com>","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"},"content":"This parameters may be varied in accordance with hardware specifics.\nSo lets add the corresponding settings to the usb251x driver dts\nspecification.\n\nSigned-off-by: Serge Semin <fancer.lancer@gmail.com>\n---\n Documentation/devicetree/bindings/usb/usb251xb.txt   |  6 ++++++\n drivers/usb/misc/usb251xb.c                          | 20 ++++++++++++++++----\n 2 files changed, 22 insertions(+), 4 deletions(-)","diff":"diff --git a/Documentation/devicetree/bindings/usb/usb251xb.txt b/Documentation/devicetree/bindings/usb/usb251xb.txt\nindex 3d84626d3..dd59a32e7 100644\n--- a/Documentation/devicetree/bindings/usb/usb251xb.txt\n+++ b/Documentation/devicetree/bindings/usb/usb251xb.txt\n@@ -44,6 +44,12 @@ Optional properties :\n \tdevice connected.\n  - sp-disabled-ports : Specifies the ports which will be self-power disabled\n  - bp-disabled-ports : Specifies the ports which will be bus-power disabled\n+ - sp-max-{power,current} : Indicates the power/current consumed by hub from\n+\tan upstream port (VBUS) when operation as a self-powered hub. The value\n+\tis given in mA in a 0 - 100 range (default is 1mA).\n+ - bp-max-{power,current} : Indicates the power/current consumed by hub from\n+\tan upstream port (VBUS) when operation as a bus-powered hub. The value\n+\tis given in mA in a 0 - 510 range (default is 100mA).\n  - power-on-time-ms : Specifies the time it takes from the time the host\n \tinitiates the power-on sequence to a port until the port has adequate\n \tpower. The value is given in ms in a 0 - 510 range (default is 100ms).\ndiff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c\nindex c308b0006..71994b883 100644\n--- a/drivers/usb/misc/usb251xb.c\n+++ b/drivers/usb/misc/usb251xb.c\n@@ -497,6 +497,22 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,\n \t\t}\n \t}\n \n+\thub->max_power_sp = USB251XB_DEF_MAX_POWER_SELF;\n+\tif (!of_property_read_u32(np, \"sp-max-power\", &property_u32))\n+\t\thub->max_power_sp = min_t(u8, property_u32 / 2, 50);\n+\n+\thub->max_power_bp = USB251XB_DEF_MAX_POWER_BUS;\n+\tif (!of_property_read_u32(np, \"bp-max-power\", &property_u32))\n+\t\thub->max_power_bp = min_t(u8, property_u32 / 2, 255);\n+\n+\thub->max_current_sp = USB251XB_DEF_MAX_CURRENT_SELF;\n+\tif (!of_property_read_u32(np, \"sp-max-current\", &property_u32))\n+\t\thub->max_current_sp = min_t(u8, property_u32 / 2, 50);\n+\n+\thub->max_current_bp = USB251XB_DEF_MAX_CURRENT_BUS;\n+\tif (!of_property_read_u32(np, \"bp-max-current\", &property_u32))\n+\t\thub->max_current_bp = min_t(u8, property_u32 / 2, 255);\n+\n \thub->power_on_time = USB251XB_DEF_POWER_ON_TIME;\n \tif (!of_property_read_u32(np, \"power-on-time-ms\", &property_u32))\n \t\thub->power_on_time = min_t(u8, property_u32 / 2, 255);\n@@ -536,10 +552,6 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,\n \t/* The following parameters are currently not exposed to devicetree, but\n \t * may be as soon as needed.\n \t */\n-\thub->max_power_sp = USB251XB_DEF_MAX_POWER_SELF;\n-\thub->max_power_bp = USB251XB_DEF_MAX_POWER_BUS;\n-\thub->max_current_sp = USB251XB_DEF_MAX_CURRENT_SELF;\n-\thub->max_current_bp = USB251XB_DEF_MAX_CURRENT_BUS;\n \thub->bat_charge_en = USB251XB_DEF_BATTERY_CHARGING_ENABLE;\n \thub->boost_up = USB251XB_DEF_BOOST_UP;\n \thub->boost_57 = USB251XB_DEF_BOOST_57;\n","prefixes":["8/9","v2"]}