Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2930720ybz; Sun, 3 May 2020 12:50:56 -0700 (PDT) X-Google-Smtp-Source: APiQypJP8wROwj/JiUnUX5mqTF3U4uhlwcHOhXlQUtMT4u6wZdfIU/JowY4PgZP9PAIHrmCTuHmX X-Received: by 2002:a50:f0dc:: with SMTP id a28mr11364468edm.87.1588535456306; Sun, 03 May 2020 12:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588535456; cv=none; d=google.com; s=arc-20160816; b=WvLYcJ+uV9HftE0A+4ERldwpW9B9GtEMHgpGnECBhtY4GaxAPolpszHs4BhMjsL8ok T0Dkg7xw1w2VlnJileRTMEtiudHNpdEpinHSd/KbuFhBTyDrRHktXk/p3JHaZapNrj3A ed7aXlvggJRAwicRvZrf0k3BrIr3zYHKcbMAJYI5LL/DDOUfwbwbuHS0JP8/i9XJHS9R mPWgVanxNL30ACNpq3ORqeIEoKWjYVGptLmharMT/wSLo8q3yrFM6ZMJtFzkB2oTO6Rk AuCHp2yQ/GhgfbuJ1suv7G8WmBSjVkaX8iCHt5o1P71RDkpSNdG4PdRKINxBCUk3NM+F x5ag== 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=PZdHzPl8mP5eIl+4bspHo31KjCYoY/epjnAlLDvwdBg=; b=zglJ7Em0ebzwB0rm/JksdTZ+xrpu+sdDZpXp0/2KX448/K10j9FKbquvCQtpkdrSQQ L+GSNyaoZV7GpUDGjgmwol7ungRqyhJ/1iC8ASbaDFp0D7dWfi5JAu8QoLaFanymJCsZ 7JNzmKV39BiyfwoqpQMtwu96kITZqTtEEizcqTZrA717fU2RGLajxuoKZiIOCbGbaTH4 OyBWOZyzRayA4Yv0JhmM27m+jihsswc/un8dh9HHpDJ44BivevJuFpEQgKT1dv5GNZbt jeAG649TtZZLzWyJtAdb2pOjObOJpgrTCsTLx3kfbtpaSuXOnEREHpLicuBIo32meiCi xq/A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si5946077edl.591.2020.05.03.12.50.04; Sun, 03 May 2020 12:50:56 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728982AbgECTlg (ORCPT + 99 others); Sun, 3 May 2020 15:41:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728843AbgECTlg (ORCPT ); Sun, 3 May 2020 15:41:36 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5A95C061A0E for ; Sun, 3 May 2020 12:41:35 -0700 (PDT) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVKUR-0006UJ-9b; Sun, 03 May 2020 21:41:27 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1jVKUQ-0005cK-AR; Sun, 03 May 2020 21:41:26 +0200 Date: Sun, 3 May 2020 21:41:26 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Andy Shevchenko Cc: Miquel Raynal , Thierry Reding , Linus Walleij , Bartosz Golaszewski , "open list:GPIO SUBSYSTEM" , linux-pwm@vger.kernel.org, Thomas Petazzoni , Linux Kernel Mailing List Subject: Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support Message-ID: <20200503194126.wlwuide5q2oxzlwt@pengutronix.de> References: <20200503105453.23658-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Andy, hello Miquel, On Sun, May 03, 2020 at 10:20:23PM +0300, Andy Shevchenko wrote: > On Sun, May 3, 2020 at 1:54 PM Miquel Raynal wrote: > > > > The MAX7313 chip is fully compatible with the PCA9535 on its basic > > functions but can also manage the intensity on each of its ports with > > PWM. Each output is independent and may be tuned with 16 values (4 > > bits per output). The period is always 32kHz, only the duty-cycle may > > be changed. One can use any output as GPIO or PWM. > > Besides the messing with parameter types (int vs. bool) it should be > rebased on top of Bartosz's tree. > > Also, it might be that we can instantiate a kind of device (MFD?) that > will share same regmap between two and have naturally different > drivers for GPIO and PWM. > > Side note: I still think this should be a function of the pin when > driver will be converted to pin control. Now this change delays the > conversion and better approach. But as I said before, if GPIO > maintainers consider this good enough to go like this, I won't object. > > Some background. It's known that some pin control devices may have PWM > function (limited, like blinking led or so, or full) and it would be > nice to have a pin mux option which enables PWM on a requested pin. Or > PWM tries to enable proper pin muxing (this sounds even better in > order of sharing same API from pin control, like "pin is available for > GPIO"). There is one thing I see as a pre-condition to the abstraction of pin-controller + GPIO + PWM: If I configure the PWM with certain parameters while the pin is still configured as GPIO there must be no visible effect on the pin. The setting must then be active when the pin is changed to PWM mode. (And vice versa: The GPIO setting must not influence the PWM output ...) I didn't check the hardware manual (or the patch), but if this needs caching of pwm and gpio parameters I would take that as a strong hint that the abstraction is wrong. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | https://www.pengutronix.de/ |