Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6629979ybe; Wed, 18 Sep 2019 06:40:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiaywuewXtvocn8YSregvboDm6qWMsoNdJJ0YM2qnEYyHqNYeGWNLLWeOWbEgZrVKQO6vd X-Received: by 2002:a50:cd1a:: with SMTP id z26mr10198965edi.75.1568814038792; Wed, 18 Sep 2019 06:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568814038; cv=none; d=google.com; s=arc-20160816; b=Aofl4Vq5nwMgFdlO+BVpM76CzJ+Q0nGgJjCgl2PkXO1SxyUAl0wd/qDLLt41nLKN4u NO3aitVoWbogUmK5LPu8w0iR+eaZ2fzEh3lRqUXFXwxFas/s7nkQowDAmFIfw4rZ3TuQ pZZbjkf598zdgcf5TTf1qVJyfQAPZTL5TZqNojLcYniHovKStK7rPsoeMQmpIyEHJox3 lkwNVwQL1W4PpFJvAmz2+eAquFo4rjambbMheV4qQfBBhaX7IIwUHq/53w8ys4CVqtHu qjDsu4H40gs2eu70Sveku9XB/Mv0Pa5Pc9OLTXqpP9VjKklY7+auyu0OX3l78uWE3oSq D91Q== 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; bh=QjQc4KIPU3tX3bKmTosLRkXzzfvbyNSrH7555KTjl4E=; b=jy0T4Bq6IE9Ygic2BRdOFR8/S3H3DY3SyJdkGkU3CuwM9bSZtUnspBYfO8zaCOpsrD uCKA1mZ7SIyMQ5M+KeE3CpdwEmDDNaqVtlUB9cWF8WyAfLxDtL0NiOBMAwooyi6MiAIc dOwXDKI2H5RdPTR7JZR0M3HEvnMYmLx22B1gkNAFUBtv8MkQxpCGELOgHUEs5gaO9ag4 Ot5I5yqY7sr9EjQV4oS7xjvwIVs69+oW/KWp3gcv1j8ERsAS7eQEgUcJB5/vYEaO3JJv dW9P6kp0HXJz+80dsWDeCTV4p9etsXtJSicA4rBk+otPTvt5trwz03+rU55ow4EOE+42 4hEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=UQBGw2zF; 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 r16si3079061edo.307.2019.09.18.06.40.15; Wed, 18 Sep 2019 06:40:38 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=UQBGw2zF; 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 S1728507AbfIRNDo (ORCPT + 99 others); Wed, 18 Sep 2019 09:03:44 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:36036 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726257AbfIRNDn (ORCPT ); Wed, 18 Sep 2019 09:03:43 -0400 Received: from pendragon.ideasonboard.com (126.92.103.87.rev.vodafone.pt [87.103.92.126]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 35E4B325; Wed, 18 Sep 2019 15:03:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1568811821; bh=Bd/SwyG0H1MmBai0JFG0Y2O/9j+qimtkExgKIEyutN4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UQBGw2zF2DMetIvPGfASDFUK+z2+czuQ8xOWA2Tntr2PP1ZLHdwNIHGfiykKn+zE2 ZJju+HHXrE+Xd7vU71iLimj0WXIyYxp51fsEyz3XwN/IVTF7MsWBYU5wH0gzbOTFbg bxqO/nc4GY6asCAmu2o7EybYuyH1p18Ct30KTuDM= Date: Wed, 18 Sep 2019 16:03:31 +0300 From: Laurent Pinchart To: Gareth Williams Cc: Yoshihiro Shimoda , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , Geert Uytterhoeven , Phil Edworthy , Fabrizio Castro , "kieran.bingham+renesas@ideasonboard.com" Subject: Re: DRM Driver implementation question Message-ID: <20190918130331.GD6306@pendragon.ideasonboard.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Gareth, Sorry for the delayed response, I was travelling for the Linux Plumbers Conference followed by a code camp. On Tue, Sep 17, 2019 at 03:27:34PM +0000, Gareth Williams wrote: > Hi Yoshihiro, > > This looks like an elegant solution that I can implement. > Many thanks for pointing me in a good direction. > > > From: Yoshihiro Shimoda, Sent: Tuesday, September 17, 2019 05:39 PM > > > > Hi Gareth, > > > > > From: Gareth Williams, Sent: Monday, September 16, 2019 10:56 PM > > > > > > Hi Laurent/Kieran, > > > > > > I need to upstream a driver for a display controller that within its > > > registers memory region contains registers related to a PWM > > > device. The PWM device is for controlling the backlight of the > > > display. > > > > > > Ideally, I would like to create a separated driver for the PWM, so > > > that I can re-use "pwm-backlight", but since the registers for the PWM > > > are right in the middle of the registers for the display > > > controller I would need to ioremap the memory region for the PWM > > > registers region twice, once from the display controller driver, > > > and once from the PWM driver. > > > > > > Do you think that the double ioremap would be acceptable upstream? > > > > I think that an MFD driver can support such hardware. I checked > > Documentation/devicetree/bindings/mfd roughly, and then atmel-hlcdc.txt > > seems to have a display controller and a PWM device. While MFD should technically work, I think it's quite overkill. You could instead bundle both the display controller and the PWM controller in the same driver. The driver would create both a DRM/KMS device and a PWM device. The DT node for your device would contain a #pwm-cells property and could thus be referenced as a PWM controller by the backlight using the pwms property. -- Regards, Laurent Pinchart