Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1428882lqe; Mon, 8 Apr 2024 08:38:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVIm7d9hynAHdfOUQuayqdmom653yzUOq+iqq7KNtwIHm6L1g8sp3Qe15rONesnffC0bkodeKM2U0DnVjLyiYtWIzdoI8V0+s2KIdGwqg== X-Google-Smtp-Source: AGHT+IEbRDLEldkHLg+wRxHA8jFiESVTbCXvy6oJ3BlL6KY5Kp8+63zA7Jz8Q84zF0nnvD2hsLL5 X-Received: by 2002:a05:6359:1011:b0:186:1908:4c4f with SMTP id ib17-20020a056359101100b0018619084c4fmr5910521rwb.13.1712590719401; Mon, 08 Apr 2024 08:38:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712590719; cv=pass; d=google.com; s=arc-20160816; b=p6CS2MOXf2f5Zp7KJi4gMNa6dR572wm7GCXMgH7ERKy9yV2aC3yY5LNFKntnSQnBLb U18kJPiFeCfRTacSMysJbOzdkbcafWtjErxys/TBvoZNA66wuGuzz0sIYRSqt6s1RfR6 9h9swRReYJw4dsRXCGyEfvrOYArZAPxX79n7zM4XfNOsw2Rwkd12Q/oWeas/iL0l+I1O xoA9pbr6ZidyuPVhWJB9mbSg39xZ1J8RGcCs/oaxbszotFvucU5T+mI2Am0mQceDPHV9 CaVnlc7Z6vOuYcBp68fMJBjnt2QphMjNRX4nLi3Lih5WV3dnH4OXPFaFgShiBBPEHuZW ul3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=wTkXEvRdhVnJ54mVJhjZe6a98ZI5DlSrtEt/jRh36Go=; fh=BG3t0rlwtJqF04gL/4yJVQvT9Rvr29GsZWL5ySM93Xw=; b=Hzso67IQQe0+Tz9lzsSziW9NQKnrHJH92Ny1vU8Qe0tnMaGgjciezl3ToAh8cgnVcf xT2bp0YN3d37t5ZxPB5O4E2hOiNeEx1DEcMCVEtUABkhpiw8KktOMuHCcfi9U/0B7u95 mzI3gmi46AS+bt+74o9WGBeZ6t7mWrgouSuFJcgOUs3Co14gmw+mQFTPFP2QJxV774RX XJU1eq/r5aGP/t4bhmkmVt0ys9PnDDg1zWwe9Z43UDHNkqMuWqCGH6z9VUEzFB8qHLpJ NZkvp9jrJOk03tEFiyj4uGgVuuZ0ZFqNbPtUjbsg0hyI2sy78Wt4Ua4V20STwZIizq+A bQbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=CRh4jbsE; arc=pass (i=1 spf=pass spfdomain=xff.cz dkim=pass dkdomain=xff.cz dmarc=pass fromdomain=xff.cz); spf=pass (google.com: domain of linux-kernel+bounces-135586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y2-20020a634942000000b005d3a532f031si6476130pgk.257.2024.04.08.08.38.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 08:38:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=CRh4jbsE; arc=pass (i=1 spf=pass spfdomain=xff.cz dkim=pass dkdomain=xff.cz dmarc=pass fromdomain=xff.cz); spf=pass (google.com: domain of linux-kernel+bounces-135586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 1EB1CB23696 for ; Mon, 8 Apr 2024 15:17:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 360E413FD64; Mon, 8 Apr 2024 15:17:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b="CRh4jbsE" Received: from vps.xff.cz (vps.xff.cz [195.181.215.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A46EC13F44B; Mon, 8 Apr 2024 15:17:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.181.215.36 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712589469; cv=none; b=EHNe68mN/miWFr0EXBgEnhbsiq6u2XZlj2kyy8oEiVnjo3NdIkLHf7XCWG4VRNdnCDPPc4T8T0LDAwIflgtVNKasoGavgRGaxHIrDagi8tXtb5q9WcqspwHfK62cGl1Kb+ir4PgY8nugNb+dcCw7AXW0utBqYfCRKBbIhM3Stq0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712589469; c=relaxed/simple; bh=AYeVrQdvosASyC+HQOVAheJr5WOqO6RSDW3nYM7LFCE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hSY3ld3ZBMDkHWcsEF1Fp3tcdYoJ3+DOzEyX72qV3XrKwM7IUfH1I3jG+zasQNySQT7gKDD6G4+dp+Psk0U7Qpdl5qoqaGpJqQcE/q6hAgucyjUMvctwHyyy4Zg5KsJIxP5Ab9RkLUjxmfasOKXhpQIV/34VSx3uZgt/M5m9HGg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xff.cz; spf=pass smtp.mailfrom=xff.cz; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b=CRh4jbsE; arc=none smtp.client-ip=195.181.215.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xff.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xff.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1712589461; bh=AYeVrQdvosASyC+HQOVAheJr5WOqO6RSDW3nYM7LFCE=; h=Date:From:To:Cc:Subject:X-My-GPG-KeyId:References:From; b=CRh4jbsEXcrgqQwEusZ/7VrROvaujjQWLV+K0GrAG2YCVAUi2atlgp+xU9FW0szyN GLZeUxyRCXIpjE9By0ZS0jffpIuTmdVlRP6lb4aBaMLosJXInjVvUA9z60RyxoJswh 8VBmcbLNQP5sd8/yVlTxNlYkJcZUZlatizw47KUY= Date: Mon, 8 Apr 2024 17:17:41 +0200 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Krzysztof Kozlowski Cc: Pavel Machek , phone-devel@vger.kernel.org, kernel list , fiona.klute@gmx.de, martijn@brixit.nl, samuel@sholland.org, heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org Subject: Re: [PATCHv3 1/2] dt-bindings: usb: typec: anx7688: start a binding document Message-ID: Mail-Followup-To: =?utf-8?Q?Ond=C5=99ej?= Jirman , Krzysztof Kozlowski , Pavel Machek , phone-devel@vger.kernel.org, kernel list , fiona.klute@gmx.de, martijn@brixit.nl, samuel@sholland.org, heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED References: <7976e254-ed1e-406d-870b-1ecdc4b1e23c@linaro.org> <1502383c-9caf-4362-8bd6-ed719a304f08@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1502383c-9caf-4362-8bd6-ed719a304f08@linaro.org> On Mon, Apr 08, 2024 at 03:27:00PM GMT, Krzysztof Kozlowski wrote: > On 08/04/2024 14:48, Ondřej Jirman wrote: > > Yeah, I understand where the confusion is. The driver is not for anx7688 chip > > really. The driver is named anx7688, but that's mostly a historical accident at > > this point. > > > > I guess there can be a driver for anx7688 chip that can directly use the chip's > > resources from the host by directly manipulating its registers and implementing > > type-c functionality via eg. Linux's TCPM or TCPCI stack, etc. (eg. like > > fusb302 driver, or various tcpci subdrivers). > > > > But in this case the chip is driven by an optional on-chip microcontroller's > > firmware and *this driver* is specifically for *the Type-C port on Pinephone* > > We do not talk here about the driver, but bindings, so hardware. Got it. Bindings should be the same regardless of what driver would be used, whether this OCM based one, or some future one based on the above mentioned TCPCI in-kernel implementation. Hardware is the same in both cases. Just trying to imagine how to actually solve the issues... Basic thing with the I2C regulator thing is that needs to be enabled as long as anx7688 needs to communicate over I2C. Other user of this power rail is touchscreen controller for its normal power supply, and it needs to be able to disable it during system suspend. Now for things to not fail during suspend/resume based on PM callbacks invocation order, anx7688 driver needs to enable this regulator too, as long as it needs it. I can put bus-supply to I2C controller node, and read it from the ANX7688 driver I guess, by going up a DT node. Whether that's going to be acceptable, I don't know. VCONN regulator I don't know where else to put either. It doesn't seem to belong anywhere. It's not something directly connected to Type-C connector, so not part of connector bindings, and there's nothing else I can see, other than anx7688 device which needs it for core functionality. ANX7688 chip desing doesn't have integrated VCONN mosfet switches so it always needs external supply + switches that are controlled by the chip itself. There's no sensible design where someone would not want this and the driver needs to get this regulator reference from somewhere. The switches are sort of an extension of the chip. kind regards, o. > > and serves as an integration driver for quite a bunch of things that need to > > work together on Pinephone for all of the Type-C port's features to operate > > reasonably well (and one of those is some communication with anx7688 firmware > > that we use, and enabling power to this chip and other things as appropriate, > > based on the communication from the firmware). > > That's still looking like putting board design into particular device > binding. > > > > > It handles the specific needs of the Pinephone's Type-C implementation, all of > > its quirks (of which there are many over several HW revisions) that can't be > > handled by the particular implementation of on-chip microcontroller firmware > > directly and need host side interaction. > > > > In an ideal world, many of the things this driver handles would be handled by > > embedded microcontroller on the board (like it is with some RK3399 based Google > > devices), but Pinephone has no such thing and this glue needs to be implemented > > somewhere in the kernel. > > You might need multiple schemas, because this is for anx7688, not for > Pinephone type-c implementation. > > However I still do not see yet a limitation of DTS requiring stuffing > some other properties into anx7688 or creating some other, virtual entity. > > > Best regards, > Krzysztof >