Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5983810ybp; Tue, 15 Oct 2019 07:57:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqx57zTOu3XdKrfHWPP3Obe9vP3JzsnY3ZdBPqzrYOSQWpPASRgQuys54vxbyLe3PnYbHhl1 X-Received: by 2002:a50:ec91:: with SMTP id e17mr33089094edr.169.1571151438990; Tue, 15 Oct 2019 07:57:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571151438; cv=none; d=google.com; s=arc-20160816; b=JKVS+lsSKFkpHeYdK1CC94AKBSSIk2JPnuXfBfoxEMbP1dqfdwwfatwsTeQ8wC0RVq 3V9CmqyborbNLif6IOh37iXup1PlXSwPASbgab6S8ee1+dx2At4uyy/nFk03udmalbs9 VU80j/Mjkl0Z4EuuCAxMk+9nMVe/uGIpVKLp3LWWlfmCvN5y+QHuzLEipTiwlJjG0ik1 rhJNATPzYJTHjEdxpCpQqjDcEF/CHhPZ7TLmqjz4Psz6SbJ/j0RA8wcTvh/W7OH+93II VyGgcsC61WHcPaB0ZKpMmVfzZ5HNh+o5PfwW/u6DAuD3GB9ALVNhG7w0qglrNKHtqc1S PhFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MoRLQz9qQnnVM1y2LSZvCw9MdLFXu/hnDRgkUKNBBAM=; b=0w2ns9P9p3PzHbe8slD7bH2rYjhW3+vHb+TF2xLj8XymGySzvXqNeRs1+eb9STyRCB NzfN14yX+T2gIzUgxWnNWJWLzTUPG2peyUH2OwdcuuzUaIlvO3+ZrOBuvKjTgKSNMPgj 4vFFwUl1AzYEwCKbF7Am6fZzSEuVFd0UYRpOjcLhlvPmH0Fw1O7XKTs3+V1a6RseDLjn ro3dblwERPVRZO3q1G4VileWeH5EGhAfxlmmD/UqTy7u4DO/ucvBAPRQNedGmC6U9ww1 GEVX16MRbLkF66q6aSYRar3XNLI7y59QMdY5Nf730NHlibHbW4qWneiVNv3HK/k9rSeZ pd+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KRXATf+I; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si14020238eje.151.2019.10.15.07.56.55; Tue, 15 Oct 2019 07:57:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KRXATf+I; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733001AbfJOOzq (ORCPT + 99 others); Tue, 15 Oct 2019 10:55:46 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46524 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732567AbfJOOzq (ORCPT ); Tue, 15 Oct 2019 10:55:46 -0400 Received: by mail-pf1-f194.google.com with SMTP id q5so12624656pfg.13; Tue, 15 Oct 2019 07:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MoRLQz9qQnnVM1y2LSZvCw9MdLFXu/hnDRgkUKNBBAM=; b=KRXATf+InZy/eTJ79BVO3AuOMNIRR9ivYDZCSXLPTJHC8PkUoymSBomp5F+30QsIeJ 5uADk1qDojD3CeFNgHP4uDnZvCRTR1ft4zYh5mfuKF6bnaSF34vWaNgg4tBvvP1TwH6F +TOPa677gZ2o1S16WPdKqhpglnhQtjT3SGxfaIvHipYHISC7J0ixhFHwgeSOFZ0jqxzs 89y1/RjkRiAyrGuINClu04IIXEhFlfvnVdp1kH26aBIfePmGG4fcE02TurHrpbviZoti GOYeULbCjGEIsYux0/FwNdkUzhdew/+E1MVfAABzRxmNKlFOjNAZ8wYIgrhVS1WiGh8O Rf5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MoRLQz9qQnnVM1y2LSZvCw9MdLFXu/hnDRgkUKNBBAM=; b=gg92unOTLeXiLlYQ0+EHwjc/pJXfR22fDMjDC9RUgPl8aKXU2hNej8rmP8sNoRVFhR zew8o/wJjYs/xco2+2lXda5hBMQRz/PzohSLE6AL6ctERPq/CaYCFwbh2nrkQ2wODHWX sSpQOuLkk4BBa+erGCIuXlYQTvK0pW1SLbeFyBWxXyAbSE4+1Ws4H5D7YnQHPgDmShjk kBbGOpMBOshlOA2OQvHcbEQe0A7NVSP8bUXCxZfkTX6ePW8b2HM8AJgmc9ZxWIQWS35B eTkDWj7aZlMUKdoEsJZzcDTsfCSMeZZuzXucawLZIUPnYJ+avYt9u6GMyQncfZqzpdGz +0lA== X-Gm-Message-State: APjAAAUVKICMeHIZfbs6MGx7ivioNFPbbtmfa9veaoAy/nKHtEybVigd cqterRaQ+oYnb2acCpg8lH8Xo5hw/qIdA/JA4pY= X-Received: by 2002:a63:d0a:: with SMTP id c10mr37925179pgl.203.1571151344336; Tue, 15 Oct 2019 07:55:44 -0700 (PDT) MIME-Version: 1.0 References: <20191014124803.13661-1-miquel.raynal@bootlin.com> <20191015163055.0d8f44e5@xps13> In-Reply-To: <20191015163055.0d8f44e5@xps13> From: Andy Shevchenko Date: Tue, 15 Oct 2019 17:55:33 +0300 Message-ID: Subject: Re: [PATCH] gpio: pca953x: Add Maxim MAX7313 PWM support To: Miquel Raynal Cc: Linus Walleij , Bartosz Golaszewski , Thierry Reding , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , "open list:GPIO SUBSYSTEM" , linux-pwm@vger.kernel.org, Linux Kernel Mailing List , Thomas Petazzoni Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 15, 2019 at 5:30 PM Miquel Raynal wrote: > > Hi Andy, > > Thanks for the feedback. > > Andy Shevchenko wrote on Mon, 14 Oct 2019 > 20:59:01 +0300: > > > On Mon, Oct 14, 2019 at 4:09 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. > > > > Can we rather not contaminate driver with this? > > > > Just register a separate PWM driver and export its functionality to > > GPIO, or other way around (in the latter case we actually have PCA8685 > > which provides a GPIO fgunctionality). > > > > I understand your concern but I am not sure to understand which > solution you have in mind. In the former case, could you explain a bit > more what you are thinking about? Would linking the PWM support with > the GPIO driver (code would be located in another .c file) work for > you? Or maybe you would prefer an MFD on top of the GPIO driver? > > As for the later case, I am not willing to re-implement GPIO support in > an alternate driver for an already supported chip, it is too much work > for the time I can spend on it. drivers/pwm/pwm-max7313.c: probe(platform_device) { struct regmap = pdata; ... } --- 8< --- 8< --- drivers/gpio/gpio-pca953x.c: probe() { struct regmap rm; ... if (dev_has_pwm) pca953x_register_pwm_driver(rm); ... } In the above regmap may be replaced with some (shared) container. Or other way around. PWM registers GPIO (which actually I prefer since we have PCA9685 case where PWM provides GPIO functionality, though via different means) -- With Best Regards, Andy Shevchenko