Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1309101lqt; Sat, 20 Apr 2024 09:12:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVIjSB8bCxI9o5A51xyBKmmXSTmdXg+upl1o+60Xv/PErYdor2adMoRWMvmyL7UlAUm2ZV4VegXya/UcGdfwIYlwouDpS4DklBnUN6+ug== X-Google-Smtp-Source: AGHT+IHOIFWFKE1KEzzVBSpVz9aGFgwCIXTl28YBCjkjHBqx6Mf1YsVVOW5EMaIc/bqhBlTrmbig X-Received: by 2002:a17:902:f652:b0:1e2:82fc:bf71 with SMTP id m18-20020a170902f65200b001e282fcbf71mr6722393plg.22.1713629564018; Sat, 20 Apr 2024 09:12:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713629564; cv=pass; d=google.com; s=arc-20160816; b=wJtJ6GEdb8OBZMJn4zQqyfon4twU/VQZB7CdOKfbo0hNkS9PG/h+31jhqsA6p3y61B XdxIaJ8CptrzM0sYlvwyUGIvP3trxAkA/pe4Y3KzAC4MHmnnvZBeb9usUdy6R4nwWdCm Ma+JXpA/1EuBT9YzZUiMZc1Aju0QjR+ULIRGFX9evjwFcGXVOKwoUBlHEnPLCVsBpoOC FiuQ6sg2KSoouK1Fn08uDGU8PhbILiGem2CAZn0PcyHYgSjFcKjHszOaKtEkzqcfGusE qjYqlxjpprWk1Vfxpa9PEXo9zEd5m31PWrD6SJaX1aeH9/I6dtVHMg/QgYYTec1cNmfa en2A== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=wjJBKDNaKI0ROz+bFURwPDTbi+LX3n6MLMpFALh+vcA=; fh=N50DolVcnYyCEJlgYjRb1WGGxo5jVdHzlAcqbAg4cQQ=; b=Fbyhsj+Ng4VZKhxwjbk1DqwvbCAgBaba7Jl7GLrHmEtS/B8m5AsTF+Z+KJuNpBSul3 if+eTuhbJWJ7E1jAxLDNZHnceWzYFUmrz1oP7eOVaX1NFiVXHZpQMOFGr05BpqKlf8H4 H5em5U7FxF6Nnr7Fe2dUoXJVjMnprxW3XFNFqeoiebOSz6ez8yf4/lsiO78x1zcCZGeR voB8UQ0QAVFChOnepiGkt3WjYbYyatlBFBiGUJi0DC1IDgz73Jh1o/fNfk095ysVm+OQ xVTOBM2RCidF130ZKgLp+2NZ3vmFnALDDCJT/2ftBhK0ECeULeblwj2E2XAC01WFkbmU AWcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=sp3H5nX+; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-152321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152321-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s12-20020a17090302cc00b001e0c8eaccfdsi4908196plk.243.2024.04.20.09.12.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 09:12:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=sp3H5nX+; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-152321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152321-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4C3652828A0 for ; Sat, 20 Apr 2024 16:04:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A476D3A1CB; Sat, 20 Apr 2024 16:04:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="sp3H5nX+" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04E867F; Sat, 20 Apr 2024 16:04:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713629079; cv=none; b=ESdtoSG9ID2c5DBYMbzReJCxjvmSMKzF50FIv3CJEQ6G1Kz6//1YU9PjoxEIX5F7jCutjrimBHw/zusk2V42VwyJi+QX5zQ8y+ynBpMQ5lwdxIcSfVfsgrRErl7//QTBcL3SbXG9IEfVj3ooKsArKgAfOUHh/2PQSlBlJdZK7bY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713629079; c=relaxed/simple; bh=7L8msFWXsjgIOFymfuyiLmAka5va6AwcRXmVCbhMnws=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Nq5r9l0yYMZirIczCx64OVmIi0Uj4o7x7+G4khiVnmTut41wmNSNaIhjffWlaid1HTd71QkPLyyC903QIg2gCuuO35qB9tCGw0bwHA19VMDMeZvqt6L7aCBWTdSar2R+XvR9N3CyqutIwuhpY7kmQnn+BQ2kC9UUHxn9jlieNGE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=sp3H5nX+; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition: In-Reply-To:References; bh=wjJBKDNaKI0ROz+bFURwPDTbi+LX3n6MLMpFALh+vcA=; b=sp 3H5nX+2Ccm3oiq+FmvNNVtASCII9OZoogBVIXfg4nFBgRaP2ynqNCaYRza2TsT4xavAP48eoHKxiI RQqYUxzk8GpMEP8xH/sFTE/T4DLwyF/RWANYd3dEXdVkIQqY9Dp73lPEjtiLG6MV0nONqlY0NaFpA BS6Jx8fKGgAoCjE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1ryDCC-00DW82-EA; Sat, 20 Apr 2024 18:04:08 +0200 Date: Sat, 20 Apr 2024 18:04:08 +0200 From: Andrew Lunn To: Josua Mayer Cc: Michael Hennerich , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alexandru Tachici , Heiner Kallweit , Russell King , Jon Nettleton , Yazan Shhady , "netdev@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH net-next 2/2] net: phy: adin: add support for setting led-, link-status-pin polarity Message-ID: <6d843f6f-01f9-4ac9-a661-af452f5ab623@lunn.ch> References: <20240419-adin-pin-polarity-v1-0-eaae8708db8d@solid-run.com> <20240419-adin-pin-polarity-v1-2-eaae8708db8d@solid-run.com> <65411c68-c76a-499d-88c7-e80ca59a3027@lunn.ch> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: > Hi Andrew, > > That looks very much related! > > I was already planning to investigate adding led support ... . > > 1. for the? LINK_ST pin I believe we still need a non-led-framework > device property for setting polarity, as it is a fixed function signal > that we can't even turn on or off from software. We should separate the device tree binding from the implementation of the binding. The binding describes the hardware. The hardware is active low. And the binding can describe that. So i don't see a need for anything vendor specific. I think the real question is, can the current generic LED code be made to handle this LED, or should you have code in the PHY driver to handle this binding in a specific way for this LED? Given the restrictions on this LED, i don't think it makes sense to expose it in /sys/class/leds. But is it possible to leverage the framework to parse the binding and call the polarity function? > 2. LED_0 control not currently supported by adin driver. > The phy supports what data-sheet calls extended configuration > (disabled by default) for controlling led state (on, off, patterns). > > Since it is not default, I see the polarity setting separate from leds. > However I do believe the led_polarity_set callback is an acceptable > solution. Again, you should use the LED binding, even if you don't use the LED framework. I just wounder how much code you will duplicate if you do decide to implement the binding in the driver. And when you fully implement the control of the LED using the framework, are you going to throw the code away again? Andrew