Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2179185pxj; Sun, 16 May 2021 17:32:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiycmPWgEe3mFzkfOblmXRp4Wt4DmKBffcRbYSh64m48K3paKxe4ZaiTfv27k8v9TbTK/3 X-Received: by 2002:a02:9663:: with SMTP id c90mr53304362jai.76.1621211519780; Sun, 16 May 2021 17:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621211519; cv=none; d=google.com; s=arc-20160816; b=jNo7YQAjMZrATZ3OlCJWTwQoromIy/gbfrIMP3TEJNyLWqLrb2yaTArItHk2OTWqOA dkOASN0SNcNcMPTkFC/qFuA8OA1rGuqCqbPiFlqx+rdIcCm4CEGvUH5/oSatOdPpvrPz dI+wxbiIFzUNX+Rdd44wGU1h1gn0Mi3l3N5wdiVZmAwucxNPYrNHLREibCrlk4OniSVx qpiXtyaSwclBGh12MQkf8k86hfQqfrptYN8gLMV3wbcl8H8pyTG2j4Kb4rRA7hUwgarK 9wzcdLEDVIS68qSe77to2pgcl1s2J/Uu+Hx1vnWju9nBIoKGa9rssxDVATmNatwqf3B9 S24w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=zC492mPkBn9ingCoXgTAUaVrJcaY2gLfvNuMI2kNax8=; b=iO0GTgrw935Q+U6T3DQseDkXJXB5MLZR8mYa1iaZuqDEIEAR6h5xr3xAr5T6eeUy2k gNQEKh7Tdh+m9Jb7QGr1qT3qBy7fAvGWiuUYt1CuMbqMQCvj0mY57zhYxTmDTLCuSK4W LaWHFhHAnp4vjdU/Kg6ImFZlqdZWAWUX3eNbGgy/ZKtOW2bLWspIDE+sQDrKcxtwvlLS brbkI4fCrhuADItC2bZ6sEY9W5E6SfUjGdXHgfyCMRfTJ/tku2++roA9qsqzrzVqrlcF OxJw+q0TBvosW1MU33G5jizKXy9/fjU4Djw6MR/5drCBX4xOv6zll5XlABzjvKO8a9o5 IZRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b=Xrt4KLp5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w3si16277424iow.99.2021.05.16.17.31.47; Sun, 16 May 2021 17:31:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b=Xrt4KLp5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234095AbhEPVmN (ORCPT + 99 others); Sun, 16 May 2021 17:42:13 -0400 Received: from polaris.svanheule.net ([84.16.241.116]:33588 "EHLO polaris.svanheule.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233675AbhEPVmN (ORCPT ); Sun, 16 May 2021 17:42:13 -0400 Received: from [IPv6:2a02:a03f:eafb:ee01:186f:4d03:79dc:8c8e] (unknown [IPv6:2a02:a03f:eafb:ee01:186f:4d03:79dc:8c8e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 59C1F1FF4B9; Sun, 16 May 2021 23:40:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1621201256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zC492mPkBn9ingCoXgTAUaVrJcaY2gLfvNuMI2kNax8=; b=Xrt4KLp5CcPBIjQTQMHw5uJPs+RqSgzwCnzF4VaO8tv/cWnJaA/X+zGtGrh9HLVYwObqOd sFg4nDNG+4W/2ReMGDSnjUrOcyDvhbDBIAypqgXgJq3jJKYdfzBd2FdR7olgAJLTW2ZRz+ 6HniZFSYnBP0NX80Y67zhPd5NtZ/9aZtovXjgzDo5ByHVitnsFeGfMPl8O9qrQ/ZkzDVMT Ffu0zVnlLxz3eJVSZGcybpeNjeBdID/xbnio2loC+FZabTPcfzugIDQIIUo0bLZYNq4fsc wBNpLMgehFEf4tBdH/EODkrAkSDWNwHbe0fjG10GzZW7pUFCFf/rxNuFwEAK6Q== Message-ID: Subject: Re: [PATCH 0/5] RTL8231 GPIO expander support From: Sander Vanheule To: Andy Shevchenko Cc: Pavel Machek , Rob Herring , Lee Jones , Linus Walleij , "linux-leds@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Date: Sun, 16 May 2021 23:40:51 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-05-12 at 18:29 +0300, Andy Shevchenko wrote: > > > On Tuesday, May 11, 2021, Sander Vanheule wrote: > > The RTL8231 GPIO and LED expander can be configured for use as an MDIO or > > SMI > > bus device. Currently only the MDIO mode is supported, although SMI mode > > support should be fairly straightforward, once an SMI bus driver is > > available. > > > > Provided features by the RTL8231: > >   - Up to 37 GPIOs > >     - Configurable drive strength: 8mA or 4mA (currently unsupported) > >     - Input debouncing on high GPIOs (currently unsupported) > >   - Up to 88 LEDs in multiple scan matrix groups > >     - On, off, or one of six toggling intervals > >     - "single-color mode": 2×36 single color LEDs + 8 bi-color LEDs > >     - "bi-color mode": (12 + 2×6) bi-color LEDs + 24 single color LEDs > >   - Up to one PWM output (currently unsupported) > >     - Fixed duty cycle, 8 selectable frequencies (1.2kHz - 4.8kHz) > > > > There remain some log warnings when probing the device, possibly due to the > > way > > I'm using the MFD subsystem. Would it be possible to avoid these? > > [    2.602242] rtl8231-pinctrl: Failed to locate of_node [id: -2] > > [    2.609380] rtl8231-pinctrl rtl8231-pinctrl.0.auto: no of_node; not > > parsing pinctrl DT > > > > When no 'leds' sub-node is specified: > > [    2.922262] rtl8231-leds: Failed to locate of_node [id: -2] > > [    2.967149] rtl8231-leds rtl8231-leds.1.auto: no of_node; not parsing > > pinctrl DT > > [    2.975673] rtl8231-leds rtl8231-leds.1.auto: scan mode missing or > > invalid > > [    2.983531] rtl8231-leds: probe of rtl8231-leds.1.auto failed with error > > -22 > > > > > > > I have several comments to the series, but I may give them next week. > > Just couple here: > 1. If subsystem provides a regmap API I would suggest to use it, I.o.w. try > again to understand what is wrong with MDIO case. Are you referring to the MDIO regmap interface, or the GPIO regmap interface? For the MDIO regmap interface, I have been able to resolve the Kconfig dependency issue. So I can reintroduce that, if that's preferred over the solution in this v1. With an extra patch, I was able to use the gpio-regmap interface, dropping most of the GPIO code. The current gpio-regmap implementation makes the assumption that an output value can be set while a pin is configured as an input. That assumption is invalid for this chip, so I had to provide an extra flag for gpio_regmap_config, similar to how this is handled in gpio-mmio. > 2. Please, switch to fwnode API in LED driver Since you had the same comment on my previous patch set, I had already tried to this this into account as much as possible. There's a few things I couldn't find the fwnode-equivalent for: * I use of_node_name_prefix to enforce the naming required by the binding. I could just walk over all (available) child nodes, which would be mostly equivalent. * To get the address of an LED child node, I use of_get_address, since this appeared to provide what I want to do: get the address of the node. I know next to nothing about ACPI. Does the equivalent exist there? Or am I taking the wrong approach? I have updated patches ready, if you would rather just review a v2. Best, Sander