Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1211766rwl; Fri, 7 Apr 2023 11:42:34 -0700 (PDT) X-Google-Smtp-Source: AKy350bsQVTt8ExLXvobJpUyIAU+0M7pAIPBEoHl9XkUCHlhwrNrF7NiOZEo8P09G4YkpFq7JpQ/ X-Received: by 2002:a05:6402:719:b0:4a2:588f:b3c5 with SMTP id w25-20020a056402071900b004a2588fb3c5mr2299106edx.21.1680892954171; Fri, 07 Apr 2023 11:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680892954; cv=none; d=google.com; s=arc-20160816; b=g0RU19K8yBJrlYBUoct0GTnYyssWiwlWRP+ArT1J/zpPqeaCR9faYuGEtqq7yJIFAl v5FqJ4q097mSHJplz+HmdMMHaGUFP/FNyjf+EQ9GS3HNcNTYo5QU4WWDzzhiuyXJ/scm 4Las6Q5W1GvWoyUBwmxIqxTR+dju1SLuYsfJCDqNIq+VsBWDFna/ZA0qRs9XRKkJxNNe FD36FCLW5rTFqSBqh+P3r2oPlqXUM2XY8EuOpsJvi/1BzIlCyUIVUu2p1EmUKwYdgKaO gyjD35U+1Q5qJ/Q7FKnrYQZgMyQx3vF6ewQzPXcn78ZryV8eKOFInmcsYAJFv+JepaVe gNgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:date:from; bh=kFvNEJfhKXkHNqVzxqnu2AYvPIrWhhw8PT/h96oxA+I=; b=otk+Cvcpsry7q82mESUPD5400Fda7V6V9SYMFU8RkdsGFK+Pn4KvdmoUW3rIJoM8Tl J6PoKYFUBATuFvP6VSANHQVMcdiX4gfoxLFO6pz9MMzXDg96R2TsQ4Crvkeb+VEkJAzx N4U3XHhL8RdpF0F6NlOTan7AHvbMM9adJzdVf0IquHsTbBjzpfvX+HNfEjzmkC6VZMHu KP7uS3IVnV12bB8vLSTBMPCh8IDd/wLpZchBS2zjHnJn3iQnGHqNUVPaurncJhS/pwmp a7mAK7Dns0PWoTP9x0CLG6Kpe6K1eoaFzvLYrE0UKRZFWlcP6CXbURQe6AKk5s/UjV1a /Qpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u14-20020a05640207ce00b004bf3fa9a025si3566155edy.605.2023.04.07.11.42.09; Fri, 07 Apr 2023 11:42:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229658AbjDGSgw (ORCPT + 99 others); Fri, 7 Apr 2023 14:36:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbjDGSgv (ORCPT ); Fri, 7 Apr 2023 14:36:51 -0400 Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA0B093C8 for ; Fri, 7 Apr 2023 11:36:49 -0700 (PDT) Received: from localhost (88-113-24-128.elisa-laajakaista.fi [88.113.24.128]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 260eab40-d573-11ed-abf4-005056bdd08f; Fri, 07 Apr 2023 21:36:46 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Fri, 7 Apr 2023 21:36:45 +0300 To: Linus Walleij Cc: Michael Walle , "Sahin, Okan" , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 2/2] gpio: ds4520: Add ADI DS4520 Regulator Support Message-ID: References: <20230327130010.8342-1-okan.sahin@analog.com> <20230327130010.8342-3-okan.sahin@analog.com> <25e1fda4b6df2d10444d7eca3cd0e387@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=3.2 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fri, Apr 07, 2023 at 03:48:25PM +0200, Linus Walleij kirjoitti: > On Wed, Apr 5, 2023 at 3:57 PM Michael Walle wrote: > > > OTOH I'm not sure the driver is doing it correctly, because it also > > seems to switch the pullup resisters together with the direction. > > I'm not sure that is correct. So there might be just one register > > involved after all and the GPIO_REGMAP should work again. > > I'm pretty sure that should be in the .set_config() callback. > > > Also, according to the datasheet this has some nv memory (to set the > > initial state of the GPIOs [?]). So it should really be a multi-function > > device. I'm not sure if this has to be considered right from the > > beginning or if the device support can start with GPIO only and later > > be transitioned to a full featured MFD (probably with nvmem support). > > That's a bit of a soft definition. > > If the chip is *only* doing GPIO and nvram it can be a GPIO-only > device I think. > > The precedent is a ton of ethernet drivers with nvram for storing > e.g. the MAC address. We don't make all of those into MFDs, > as the nvram is closely tied to the one and only function of the > block. I agree with Linus. This should be part of the actual (main) driver for the chip as many do (like USB to serial adapters that have GPIO capability). Also this code lacks of proper locking and has style issues. -- With Best Regards, Andy Shevchenko