Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2191744imm; Thu, 9 Aug 2018 08:45:14 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxvW/A7zhl+u8yMxG0+e2+B0FXo1p5VuUQptBpv+Tz4ds3GBPoiOWMShksUMLLP1rVkTP3D X-Received: by 2002:a63:8548:: with SMTP id u69-v6mr2684118pgd.346.1533829514754; Thu, 09 Aug 2018 08:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533829514; cv=none; d=google.com; s=arc-20160816; b=GYP18k/6FANHdypODcJhqsYIHhdmY7pr6AxFo+7gHjkX89T/sGvq3UX4nRReI0SYnF kRJMzC6cx11svXXdDUhUV5WeoK9vn5gIOsQDZW0DaBDsbFfhsESA1Jh3WFpjDm2fvHa5 xNvzF249Bwt196Ds5nNwV0C3oE7IdazxXWbm+JdraEjIjwJikeoo6New9wQhf7KY1q2D y6+aHyT85eGZttPHRrvtjG2NVjRoSqxLk5BgBlJpLI9faqh2NPgSnZhlKXTlEuWqRixw 84b1TFxnYxD0TiJpPb1ZnHGHvFV+LB+InNpDvQeohOtdNrh2zcdAIrWmOjN5PYQ00trD rsFQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=0l4VFTV4SKU1AZWUzXX+VlHcSV59UxgK9GEEs7SeLcQ=; b=mIuShFvpVEjUog4fojC+9XR3Q48tiuPSXQIDa6P2oBDLPW1+D5AhZ+e7OGqgbc8MlX qKJB2HcTCiL9WeAADCBgHTRRePc/+2M5luYalwGtK7vw0Xbiy4MN8rFDqs5oAQkeT3do zRFQRrsabFwKgo0R66A3uJ1sbjGY/tAdpDdK1JE3PUa1lmRhXupMGej04U8nBPJrDNo3 E41Et4xfu8WnN0yifPPvUzpPPh7sfA3qV1O3ZURiLnw0dqJVFfrt+u7YgBLKNpem2uOq Y1hbR3Cl4m+3zgIkWq7jWMwUBkqMy7crO/aeu0LJVuQOXLJWXdn/bqn1nQ6py3Q5Kq+f 55OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=6Vopnwue; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 36-v6si7794032pgr.176.2018.08.09.08.45.00; Thu, 09 Aug 2018 08:45:14 -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=@lunn.ch header.s=20171124 header.b=6Vopnwue; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732518AbeHISIh (ORCPT + 99 others); Thu, 9 Aug 2018 14:08:37 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:60022 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731062AbeHISIh (ORCPT ); Thu, 9 Aug 2018 14:08:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=0l4VFTV4SKU1AZWUzXX+VlHcSV59UxgK9GEEs7SeLcQ=; b=6Vopnwue01N76CkXJholiCGmBrbo0n0dadLdSyZamMoHPDXnDwWsqIXsRCEtM6S2j4fGmwJuPN1J0qy3RWIH6vQPc2jBeLSNn2ep0h9ceD4rD9kx4gI0d1ss+4RF3yOhdSifLLUuuDu9C/Q71LcQ4PfqBbkc7MsjM1tiS7CuOtw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1fnn5d-00067W-BP; Thu, 09 Aug 2018 17:43:05 +0200 Date: Thu, 9 Aug 2018 17:43:05 +0200 From: Andrew Lunn To: Richard Genoud Cc: Aditya Prayoga , linux-gpio@vger.kernel.org, Gregory CLEMENT , Gauthier Provost , Alban Browaeys , Thierry Reding , Linus Walleij , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, Dennis Gilmore , Ralph Sennhauser Subject: Re: [PATCH RESEND 2/2] gpio: mvebu: Allow to use non-default PWM counter Message-ID: <20180809154305.GE20006@lunn.ch> References: <1533522556-55055-1-git-send-email-aditya@kobol.io> <1533522556-55055-3-git-send-email-aditya@kobol.io> <20180806135257.GB6584@lunn.ch> <9d12abba-0be8-bce7-45d5-99659cbe0915@sorico.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9d12abba-0be8-bce7-45d5-99659cbe0915@sorico.fr> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I'm not sure that the logic: > 1. Default counter assigned to the bank > 2. Unused counter that is assigned to other bank > 3. Fallback to default counter > is the best one. Hi Richard It it totally broken, as you point out. That is why i said it needs to be limited to two PWMs. > IMHO, I would either: > - allow only 2 pwm and no more (but that's a pity) > - allow lots of fans, but once 2 different speeds are set, return > EINVAL for another different speed (even if it's on another bank) This second option also breaks the Linux PWM model. What you should be thinking about is extending the Linux PWM model so that one PWM can drive more than one pin. Andrew