Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2436953ybl; Thu, 19 Dec 2019 13:39:54 -0800 (PST) X-Google-Smtp-Source: APXvYqyu5iiiMjWLblaAZoCx87mnehgxgcMVIZoJixahUFoE73vJseOzAIHpKx6rkPo+7m4hXPTN X-Received: by 2002:aca:c493:: with SMTP id u141mr3191986oif.62.1576791594355; Thu, 19 Dec 2019 13:39:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576791594; cv=none; d=google.com; s=arc-20160816; b=yYDf4ltvbUstnO8+6QtOnJ7apBgXhEd1qjM7Cyoi3SXrJtca+TymZp5gcwEtzc3Vv0 buZMima9tHMwhmevuqWM+u95lRvfXRsYQq05JjvoNTWu6h8j0ao6/21T7LZehrSh8SyA D88cr3mnQkmIUCMGzv5rmBg6+yYbtWwG1UJ5w1Zx3q/TaJ6df7y34ct0QfMyRef574SL 4CIEq1C9/LUptIL9fD2rhmruT0a1R9WDDhm9NMULL/v58gGhmD8AGCXJ+eTlKLiDdfG/ LIF46gRI8+18tAgd/AvL1pkUpmxQPf2TXRJw1PbxIdfEAYctsZH96IInD+9oo8LJW1gj FoVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=A8qzfXgJqfz0JsylJ7w5yc0iwoDWilLcpVP41fGSaVY=; b=pQxmYLVyMfskGUKN1JdTKiMjqaie1/nJAZ+7+w0MA5jOFIchLMd2PWjb09eiiOfPEn JckL7NON3z++QpcKocvSBJ2u5SsseCgnPv6jRyE2tBzX28uzOH/1+bD/3yLxFG+c43kd BGhecFzAQHOC3Y8oLqyDw6ydAMfkAlvo9MjgJLPjmAM46T/LYHld0htRXljurBLbLfQE lda1IjaLIpmqNEKXDrYe5tGZ9wCVSFsTo6aN3bNVgHbulFSMolIWytcrWfflbs2ChLew D1dfAFJrKek0kJS/N+0YuJA2At73lOwdbneg3eYmphGh0tjJYkoNKLebeyuK6p5rGd5G UXvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d4si3455974oig.155.2019.12.19.13.39.42; Thu, 19 Dec 2019 13:39:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727422AbfLSViu (ORCPT + 99 others); Thu, 19 Dec 2019 16:38:50 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46364 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726880AbfLSViu (ORCPT ); Thu, 19 Dec 2019 16:38:50 -0500 Received: by mail-pf1-f194.google.com with SMTP id y14so4005794pfm.13; Thu, 19 Dec 2019 13:38:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=A8qzfXgJqfz0JsylJ7w5yc0iwoDWilLcpVP41fGSaVY=; b=sp6jN/DAYmh1enzLowAxt+CQNyzsEJFI4+AW3rDNa98uIQiqkHydnmsh4uBOi0hujT hM+8ZT5cd1m5ZN7C10poqLosAYdj4Hi2i3bIaYJ3ksj/3Ibko6A/nJeCmwcMM58c3f4V PHvHESWX3AQIOHxMkssH6KXSfZr1g1xwXk8AgBDtkkz2jvGkfe5l0yGqV0AYao8YuUdl KDowwrZsS5ynK6XrZf+Dc/Bty4NpMwCVVxaBnbXXhb13V214oME/1nosB6bFQTrHrCBL PAOl23apfnUVawQ72qrtdc74WHa5c1NmgC9V54FZjDIX2jwdfOXEN7GpZDO7QaeakdzI DUYA== X-Gm-Message-State: APjAAAVd2O+lEC7uBWbOsslf5W9RabYx83PsGHK9Mtoi5hrHfWlWP1wf ozyDDNbgp9th1RpaPEhrRw== X-Received: by 2002:a63:a707:: with SMTP id d7mr10954574pgf.93.1576791529663; Thu, 19 Dec 2019 13:38:49 -0800 (PST) Received: from localhost ([172.58.27.162]) by smtp.gmail.com with ESMTPSA id p5sm8161313pgs.28.2019.12.19.13.38.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 13:38:48 -0800 (PST) Date: Thu, 19 Dec 2019 13:38:45 -0800 From: Rob Herring To: Paul Cercueil Cc: Peter Chen , Sebastian Reichel , Mark Rutland , Greg Kroah-Hartman , od@zcrc.me, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v2 3/3] power/supply: Add generic USB charger driver Message-ID: <20191219213845.GA3481@bogus> References: <20191211155032.167032-1-paul@crapouillou.net> <20191211155032.167032-3-paul@crapouillou.net> <20191212091814.GA7035@b29397-desktop> <1576270147.3.0@crapouillou.net> <1576493525.3.0@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1576493525.3.0@crapouillou.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 16, 2019 at 11:52:05AM +0100, Paul Cercueil wrote: > Hi Peter, > > > Le lun., d?c. 16, 2019 at 01:24, Peter Chen a ?crit : > > > > > >> + > > > >> + desc = &charger->desc; > > > >> + desc->name = "usb-charger"; > > > >> + desc->properties = usb_charger_properties; > > > >> + desc->num_properties = ARRAY_SIZE(usb_charger_properties); > > > >> + desc->get_property = usb_charger_get_property; > > > >> + desc->type = POWER_SUPPLY_TYPE_USB; > > > > > > > > What's your further plan for this generic USB charger? > > > > To support BC1.2, we need to know charger type, and how we could > > > get > > > > it? > > > > > > > > Peter > > > > > > Well I don't really know. The USB role framework does not give any > > > info about > > > what's plugged. > > > > > > > What's the use case for this patch set? How it be used? > > My devicetree: > > usb_otg: usb@13440000 { > compatible = "ingenic,jz4770-musb", "simple-mfd"; > reg = <0x13440000 0x10000>; > [...] > > usb-role-switch; > > connector { > compatible = "gpio-usb-b-connector", "usb-b-connector"; > label = "mini-USB"; > type = "mini"; > > id-gpios = <&gpf 18 GPIO_ACTIVE_HIGH>; > vbus-gpios = <&gpb 5 GPIO_ACTIVE_HIGH>; > [...] > }; > > usb_charger: usb-charger { > compatible = "usb-charger"; What h/w device is this? > }; > }; > > The new gpio-usb-connector driver uses the ID/VBUS GPIOs to detect in which > state (device, host, unconnected) a OTG connector is. However, that means I > cannot use the standard gpio-charger driver to detect the presence of a > charger based on the state of the VBUS gpio, since it's already requested > here. So the point of this patchset is to provide an alternative to > gpio-charger that works with OTG controllers compatible with > 'usb-role-switch'. Why not fix gpio-charger or make whatever 'owns' vbus-gpios to register a charger device? I guess you could have Vbus sensing with no charging capability, but that sounds like a new property, not a node to me. Rob