From patchwork Fri Oct 8 13:18:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sugumar Natarajan X-Patchwork-Id: 241291 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 o98E0Snh001373 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 8 Oct 2010 14:00:50 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o98Dwx9Q007783 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Oct 2010 08:58:59 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o98DwwsR004980; Fri, 8 Oct 2010 08:58:59 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id F1F5B8071D; Fri, 8 Oct 2010 08:58:22 -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 34D70806B6 for ; Fri, 8 Oct 2010 08:57:44 -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 o98DvgAH015794; Fri, 8 Oct 2010 08:57:42 -0500 (CDT) Received: from symphonyindia.ti.com (symphony-ftp [192.168.247.11]) by tidmzi-ftp.india.ext.ti.com (Postfix) with SMTP id 1A77A3887A; Fri, 8 Oct 2010 19:27:36 +0530 (IST) Received: from localhost.localdomain ([192.168.247.76]) by symphonyindia.ti.com (8.13.1/8.12.10) with ESMTP id o98Dolh6031974; Fri, 8 Oct 2010 19:20:47 +0530 From: sugumar To: linux-embedded@vger.kernel.org Subject: [PATCH 4/4] davinci: da850/omap-l138 evm: Platform support for backlight driver Date: Fri, 8 Oct 2010 18:48:01 +0530 Message-Id: <1286543881-32141-1-git-send-email-sugumar@ti.com> X-Mailer: git-send-email 1.5.6 Cc: davinci-linux-open-source@linux.davincidsp.com 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]); Fri, 08 Oct 2010 14:00:50 +0000 (UTC) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index b280efb..fe88e37 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -37,6 +37,7 @@ #include #include +#include #define DA850_EVM_PHY_MASK 0x1 #define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */ @@ -48,6 +49,28 @@ #define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6) + +#define DAVINCI_BACKLIGHT_MAX_BRIGHTNESS 250 +#define DAVINVI_BACKLIGHT_DEFAULT_BRIGHTNESS 250 +#define DAVINCI_PWM_PERIOD_NANO_SECONDS (1000000 * 10) + +static struct platform_pwm_backlight_data da850evm_backlight_data = { + .pwm_id = "ecap.2", + .ch = 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", + .id = -1, + .dev = { + .platform_data = &da850evm_backlight_data, + }, +}; + + static struct mtd_partition da850_evm_norflash_partition[] = { { .name = "bootloaders + env", @@ -633,6 +656,20 @@ static int __init da850_evm_config_emac(void) pr_warning("da850_evm_init: emac registration 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("da850_evm_init: backlight device registration " + "failed: %d\n", ret); + return 0; } device_initcall(da850_evm_config_emac);