From patchwork Sat May 7 15:21:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Dimitrov X-Patchwork-Id: 9038201 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D24CDBF29F for ; Sat, 7 May 2016 15:25:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D2DF1200ED for ; Sat, 7 May 2016 15:25:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5168720138 for ; Sat, 7 May 2016 15:24:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1az44g-0004GT-1u; Sat, 07 May 2016 15:23:22 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1az444-00042m-Fz for linux-arm-kernel@lists.infradead.org; Sat, 07 May 2016 15:22:45 +0000 Received: by mail-wm0-x241.google.com with SMTP id e201so13349338wme.2 for ; Sat, 07 May 2016 08:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GinrgJrTRLC+js6dSLJbWnWLrPq0CMOADryyxXRBTmc=; b=yp9LAJlHEHxOAxFMTcjpIBnaWqn21W4Ic8MMhJh1GNpUedHmCBXzn0RS+k+/3ORhGP /JVnEd6D+/rTFva2+oUtVIrKwf9bC8lcXMicbv1trjj5VJrje4ZhATG4kP/273rumdbv zL5PVE40QohkDhJHsU92QiRSiOzK0e6PwgTgsyR1q6/obZZsZp4VqFS7G65oiTn/UVIP JWMKBzkt/PbkFD0y/JzCcsvzWwHPSjBn2I5BYRB9dHx0xp1ERqON7IskutaY3yKAu9Py dZ65cqpFaVt2WDrDnEOhioKUhpcylgfUXaNB9myLOPfJuqSTCc231JUnh355p02l/X4n yyrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GinrgJrTRLC+js6dSLJbWnWLrPq0CMOADryyxXRBTmc=; b=SGXgQ/vjMuxeyrfDbM6u93LCC01lP0Ai+ptrjBZOFwH1SyL+5l7yTS/I0Q/3yRMyzi AYYu442OFzxku79lkhX5NDLxndlSGcbSiDdwm96c69Ur7i2i8qyVKe/RGhxUtydv+sEn OytFnCR/HH5+LFp6N/bF1LTMWF9glND5f+jh5nRygouZ4yg88TWFlfh/3VFh2SvFOOjN TbX5eY9+GjDQ3ivkKNcJ/2SPmQZo3TVOfoyKi0BWIgJNW7DY5ZFwDzvv3+z9rjWDhuIy Fsc8x23Dq0w/pejD0O6UEDkUYQltBDAr+XapLPGKTdQmQ8LhwRY+UFtbsV7XsgE7y8l3 IZcA== X-Gm-Message-State: AOPr4FXDVCowsiJ8baIdFYoYkfX883yvwyUU4rdOv5CtGUCrj5Bi8owmIJceRL1HB5uZ5Q== X-Received: by 10.28.109.86 with SMTP id i83mr2855317wmc.75.1462634542963; Sat, 07 May 2016 08:22:22 -0700 (PDT) Received: from localhost.localdomain ([46.249.74.23]) by smtp.gmail.com with ESMTPSA id jq1sm20737835wjc.28.2016.05.07.08.22.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 07 May 2016 08:22:22 -0700 (PDT) From: Ivaylo Dimitrov To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, thierry.reding@gmail.com, bcousson@baylibre.com, tony@atomide.com, linux@arm.linux.org.uk, mchehab@osg.samsung.com Subject: [PATCH 4/7] [media] ir-rx51: add DT support to driver Date: Sat, 7 May 2016 18:21:45 +0300 Message-Id: <1462634508-24961-5-git-send-email-ivo.g.dimitrov.75@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1462634508-24961-1-git-send-email-ivo.g.dimitrov.75@gmail.com> References: <1462634508-24961-1-git-send-email-ivo.g.dimitrov.75@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160507_082244_831960_2EF4DB4D X-CRM114-Status: GOOD ( 18.07 ) X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Ivaylo Dimitrov , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, sre@kernel.org, pali.rohar@gmail.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With the upcoming removal of legacy boot, lets add support to one of the last N900 drivers remaining without it. As the driver still uses omap dmtimer, add auxdata as well. Signed-off-by: Ivaylo Dimitrov --- .../devicetree/bindings/media/nokia,lirc-rx51 | 19 +++++++++++++++++++ arch/arm/mach-omap2/pdata-quirks.c | 6 +----- drivers/media/rc/ir-rx51.c | 11 ++++++++++- 3 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/nokia,lirc-rx51 diff --git a/Documentation/devicetree/bindings/media/nokia,lirc-rx51 b/Documentation/devicetree/bindings/media/nokia,lirc-rx51 new file mode 100644 index 0000000..5b3081e --- /dev/null +++ b/Documentation/devicetree/bindings/media/nokia,lirc-rx51 @@ -0,0 +1,19 @@ +Device-Tree bindings for LIRC TX driver for Nokia N900(RX51) + +Required properties: + - compatible: should be "nokia,lirc-rx51". + - pwms: specifies PWM used for IR signal transmission. + +Example node: + + pwm9: dmtimer-pwm@9 { + compatible = "ti,omap-dmtimer-pwm"; + ti,timers = <&timer9>; + #pwm-cells = <3>; + }; + + ir: lirc-rx51 { + compatible = "nokia,lirc-rx51"; + + pwms = <&pwm9 0 26316 0>; /* 38000 Hz */ + }; diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index af65781..c15ccac 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c @@ -273,8 +273,6 @@ static struct platform_device omap3_rom_rng_device = { }, }; -static struct platform_device rx51_lirc_device; - static void __init nokia_n900_legacy_init(void) { hsmmc2_internal_input_clk(); @@ -293,10 +291,7 @@ static void __init nokia_n900_legacy_init(void) pr_info("RX-51: Registering OMAP3 HWRNG device\n"); platform_device_register(&omap3_rom_rng_device); - } - - platform_device_register(&rx51_lirc_device); } static void __init omap3_tao3530_legacy_init(void) @@ -534,6 +529,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { &omap3_iommu_pdata), OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x4809c000, "4809c000.mmc", &mmc_pdata[0]), OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x480b4000, "480b4000.mmc", &mmc_pdata[1]), + OF_DEV_AUXDATA("nokia,lirc-rx51", 0, "lirc-rx51", &rx51_lirc_data), /* Only on am3517 */ OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL), OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0", diff --git a/drivers/media/rc/ir-rx51.c b/drivers/media/rc/ir-rx51.c index 5096ef3..7a329d8 100644 --- a/drivers/media/rc/ir-rx51.c +++ b/drivers/media/rc/ir-rx51.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -478,6 +479,14 @@ static int lirc_rx51_remove(struct platform_device *dev) return lirc_unregister_driver(lirc_rx51_driver.minor); } +static const struct of_device_id lirc_rx51_match[] = { + { + .compatible = "nokia,lirc-rx51", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, lirc_rx51_match); + struct platform_driver lirc_rx51_platform_driver = { .probe = lirc_rx51_probe, .remove = lirc_rx51_remove, @@ -485,7 +494,7 @@ struct platform_driver lirc_rx51_platform_driver = { .resume = lirc_rx51_resume, .driver = { .name = DRIVER_NAME, - .owner = THIS_MODULE, + .of_match_table = of_match_ptr(lirc_rx51_match), }, }; module_platform_driver(lirc_rx51_platform_driver);