From patchwork Mon Sep 20 07:42:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugumar Natarajan X-Patchwork-Id: 194452 Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8K8KLOX004769 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 20 Sep 2010 08:20:57 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o8K8InJq012402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Sep 2010 03:18:49 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id o8K8IiPl010366; Mon, 20 Sep 2010 03:18:45 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 93EA48067C; Mon, 20 Sep 2010 03:17:53 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id E2E098064E for ; Mon, 20 Sep 2010 03:17:16 -0500 (CDT) Received: from tidmzi-ftp.india.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with SMTP id o8K8HFFs008088 for ; Mon, 20 Sep 2010 03:17:15 -0500 (CDT) Received: from symphonyindia.ti.com (symphony-ftp [192.168.247.11]) by tidmzi-ftp.india.ext.ti.com (Postfix) with SMTP id C9A9E3887A for ; Mon, 20 Sep 2010 13:47:10 +0530 (IST) Received: from localhost.localdomain ([192.168.247.76]) by symphonyindia.ti.com (8.13.1/8.12.10) with ESMTP id o8K8ABwJ021987; Mon, 20 Sep 2010 13:40:11 +0530 From: Sugumar Natarajan To: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 4/4] davinci: da850/omapl138 evm: Platform support for PWM based backlight driver Date: Mon, 20 Sep 2010 13:12:26 +0530 Message-Id: <1284968546-17107-1-git-send-email-sugumar@ti.com> X-Mailer: git-send-email 1.5.6 X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 20 Sep 2010 08:20:57 +0000 (UTC) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index ac2297c..77d0c89 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -106,6 +107,24 @@ static struct platform_device da850_pm_device = { .id = -1, }; +#define DAVINCI_BACKLIGHT_MAX_BRIGHTNESS 255 +#define DAVINVI_BACKLIGHT_DEFAULT_BRIGHTNESS 255 +#define DAVINCI_PWM_PERIOD_NANO_SECONDS (1000000 * 10) + +static struct platform_pwm_backlight_data da850evm_backlight_data = { + .pwm_id = 0, + .max_brightness = DAVINCI_BACKLIGHT_MAX_BRIGHTNESS, + .dft_brightness = DAVINVI_BACKLIGHT_DEFAULT_BRIGHTNESS, + .pwm_period_ns = DAVINCI_PWM_PERIOD_NANO_SECONDS, +}; + +static struct platform_device da850evm_backlight = { + .name = "pwm-backlight", + .dev = { + .platform_data = &da850evm_backlight_data, + }, +}; + /* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash * (128K blocks). It may be used instead of the (default) SPI flash * to boot, using TI's tools to install the secondary boot loader @@ -840,6 +859,19 @@ static __init void da850_evm_init(void) if (ret) pr_warning("da850_evm_init: rtc setup failed: %d\n", ret); + ret = davinci_cfg_reg(DA850_ECAP2_APWM2); + if (ret) + pr_warning("da850_evm_init:ecap mux failed ""%d\n", ret); + + ret = da850_register_ecap(); + if (ret) + pr_warning("da850_evm_init: ECAP registration failed:" + "%d\n", ret); + + ret = platform_device_register(&da850evm_backlight); + if (ret) + pr_warning("da850evm_register_backlight_failed:""%d\n", ret); + ret = da850_register_cpufreq("pll0_sysclk3"); if (ret) pr_warning("da850_evm_init: cpufreq registration failed: %d\n",