Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751479AbaG1Q6h (ORCPT ); Mon, 28 Jul 2014 12:58:37 -0400 Received: from mail-vc0-f181.google.com ([209.85.220.181]:50923 "EHLO mail-vc0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751229AbaG1Q6X convert rfc822-to-8bit (ORCPT ); Mon, 28 Jul 2014 12:58:23 -0400 MIME-Version: 1.0 X-Originating-IP: [173.13.129.225] In-Reply-To: <53D631B6.1050603@rock-chips.com> References: <1405774529-26027-1-git-send-email-caesar.wang@rock-chips.com> <1405774529-26027-3-git-send-email-caesar.wang@rock-chips.com> <20140721085001.GG8843@ulmo> <53CD0E82.6030901@rock-chips.com> <20140721132723.GH15238@ulmo> <53D23192.4000908@rock-chips.com> <53D50601.1020106@rock-chips.com> <53D631B6.1050603@rock-chips.com> Date: Mon, 28 Jul 2014 09:58:22 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] pwm: add this patch to support the new pwm of Rockchip SoCs From: Olof Johansson To: caesar Cc: Doug Anderson , Thierry Reding , linux-pwm@vger.kernel.org, "devicetree@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 28, 2014 at 4:19 AM, caesar wrote: > Doug, > 在 2014年07月28日 12:01, Doug Anderson 写道: > >> Caesar, >> >> On Sun, Jul 27, 2014 at 7:00 AM, caesar >> wrote: >>> >>> /*I think will be show the faill log:-> >>> >>> * rockchip-pwm ff9301a0.pwm: can't request region for resource [mem >>> 0xff9301a0-0xff93019f] >>> */ >>> >>> pc->base = devm_ioremap_resource(dev, regs); >> >> Did you actually code this up and try it and get this error? > > Yeah. > >> I hadn't >> tried it but I researched other dts files and it looked as if there >> was one example that was doing this. ...but perhaps it wasn't >> actually doing the ioremap_resource on both ranges. >> >> I'd imagine that this is _probably_ equivalent to what Thierry was >> suggesting, so if it didn't work then maybe Thierry's won't work >> either? >> >> I don't have any other great suggestions other than doing two memory >> ranges for lcdc: >> >> lcdc@ff930000 { >> compatible = "rockchip,rk3288-lcdc"; >> reg = <0xff930000 0x1a0>, <0xff9301b0 0xfe50>; >> ... >> }; >> pwm@ff9301a0 { >> compatible = "rockchip,vop-pwm"; >> reg = <0xff9301a0 0x10>; >> ... >> }; >> >> ...but I am certainly nowhere near an expert on this stuff... >> >> -Doug >> >> >> > I has solve in lcdc driver,but I always feel awkward. I think a good way to > solve in pwm driver. > Unfortunately that so far ,I have not a good idle in pwm driver. > > Maybe,I let do it that way in lcdc driver. I think there's an easier way to do this, by not focusing _too_ much on the device tree: * Define a platform_data structure for the PWM driver, which contains readl/writel accessors as well as the device type (i.e. what you use the compatible field and the lookup table for today). * Populate the platform_device in the clcd driver, and register that * Make the PWM driver probe as a regular platform device if pdata is passed * Make a readl/writel wrapper that either falls back to native readl/writel when there aren't any passed in, or make the DT code fill in the pdata with the native versions in that case. Going full MFD on this seems overkill, unless there is also a shared interrupt that needs to be handled. -Olof -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/