From patchwork Wed Jun 22 19:22:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Dimitrov X-Patchwork-Id: 9193557 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E9E9608A0 for ; Wed, 22 Jun 2016 19:24:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57C982840B for ; Wed, 22 Jun 2016 19:24:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C6E628414; Wed, 22 Jun 2016 19:24:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E862E28415 for ; Wed, 22 Jun 2016 19:23:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752980AbcFVTXh (ORCPT ); Wed, 22 Jun 2016 15:23:37 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34417 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752826AbcFVTXE (ORCPT ); Wed, 22 Jun 2016 15:23:04 -0400 Received: by mail-wm0-f67.google.com with SMTP id 187so4224737wmz.1; Wed, 22 Jun 2016 12:23:03 -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=vV3jXx8SLCJuK9mAnQ9K3dLVJmhdbJ2tlftWlN8GAEE=; b=ATix4JK1VmsUPK0dyoLsz5R1Rx/iP64leEVY/pBCxW/eFPNfUOZ3E8678Tkkywl0lD DF/7LunUVK4wyGXEAouStT0tcuzpkh9k383uLX9xF4U97as7unaz2f9odXaGhzLq94sq uAmolwQKZ7FpYoNvEK6wbyIVyxgY0qI2X16AbxBPA+HYXvCSou/YSQEG+3l8vbw0/gug mM5Tq9B247M7LFpQKmxkBXX1aOkBcK68I12l/JADbmkMzOpE6gm9ifEkKGPW7WJXW3bN 6I1UYeVmrIytUfbh5Z29zUYY/yKhupSQt1PJ737zeDgvyQl9q5ldQHB7t2SZICepczoV MqFg== 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=vV3jXx8SLCJuK9mAnQ9K3dLVJmhdbJ2tlftWlN8GAEE=; b=KgP6F3xyrJgik7qrXy6BtgXeMKMsidQiunKGug/uBXpb5sBUWKBDR8Z3sMdqLEq8S+ UuieCSepaTRRexLPVPbYx/wvOS19y+rUnw0GdMvXN3eddc3AkbM1L6l2BCQja+1lSVWE jK1SULHGFUeVgjVGOm/lnve376v//Vv6+EFGFk+zur5QRqCS4lr3DKezKQI2GtiR5Pnm NqZ4HVk79u4o0JmFoMNMTnG+CrLfWSSa2Q0EHo9MBNmRzG1CX6xG9DeT5D7FbkdBHCM3 kztsxXdWjqaj3akJ8i+Xh2U9VvBuGGgeMR/W/Q0vmly2GiEhy/cDvHfzjfXYMAs4YcHA TVQw== X-Gm-Message-State: ALyK8tL4ShZIPpUpElnvwhcv3bOoWknm7r09gk4erhl4k6mqJSclgWpkviYdTqHJ1QA1LQ== X-Received: by 10.28.146.9 with SMTP id u9mr10173254wmd.52.1466623382414; Wed, 22 Jun 2016 12:23:02 -0700 (PDT) Received: from localhost.localdomain ([46.249.74.23]) by smtp.gmail.com with ESMTPSA id b200sm265952wmb.9.2016.06.22.12.23.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Jun 2016 12:23:01 -0700 (PDT) From: Ivaylo Dimitrov To: robh+dt@kernel.org, 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 Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, sre@kernel.org, pali.rohar@gmail.com, pavel@ucw.cz, Ivaylo Dimitrov Subject: [RESEND PATCH v2 4/5] ir-rx51: add DT support to driver Date: Wed, 22 Jun 2016 22:22:20 +0300 Message-Id: <1466623341-30130-5-git-send-email-ivo.g.dimitrov.75@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466623341-30130-1-git-send-email-ivo.g.dimitrov.75@gmail.com> References: <1466623341-30130-1-git-send-email-ivo.g.dimitrov.75@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.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 Acked-by: Rob Herring --- .../devicetree/bindings/media/nokia,n900-ir | 20 ++++++++++++++++++++ arch/arm/mach-omap2/pdata-quirks.c | 6 +----- drivers/media/rc/ir-rx51.c | 11 ++++++++++- 3 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/nokia,n900-ir diff --git a/Documentation/devicetree/bindings/media/nokia,n900-ir b/Documentation/devicetree/bindings/media/nokia,n900-ir new file mode 100644 index 0000000..13a18ce --- /dev/null +++ b/Documentation/devicetree/bindings/media/nokia,n900-ir @@ -0,0 +1,20 @@ +Device-Tree bindings for LIRC TX driver for Nokia N900(RX51) + +Required properties: + - compatible: should be "nokia,n900-ir". + - pwms: specifies PWM used for IR signal transmission. + +Example node: + + pwm9: dmtimer-pwm@9 { + compatible = "ti,omap-dmtimer-pwm"; + ti,timers = <&timer9>; + ti,clock-source = <0x00>; /* timer_sys_ck */ + #pwm-cells = <3>; + }; + + ir: n900-ir { + compatible = "nokia,n900-ir"; + + 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 278bb8f..0d7b05a 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) @@ -531,6 +526,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,n900-ir", 0, "n900-ir", &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..1cbb43d 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,n900-ir", + }, + {}, +}; +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);