From patchwork Thu Apr 11 18:36:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Bresticker X-Patchwork-Id: 2429991 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E3C343FD8C for ; Thu, 11 Apr 2013 18:36:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755172Ab3DKSgg (ORCPT ); Thu, 11 Apr 2013 14:36:36 -0400 Received: from mail-ia0-f202.google.com ([209.85.210.202]:55174 "EHLO mail-ia0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752362Ab3DKSgf (ORCPT ); Thu, 11 Apr 2013 14:36:35 -0400 Received: by mail-ia0-f202.google.com with SMTP id h8so453464iaa.1 for ; Thu, 11 Apr 2013 11:36:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=1zW4MTx0NNQEGmpyGxYTJWLFLRKoj4LVkqSxUDYPV1s=; b=daPKCv9sAy3+F/FMCQJJY1WaFSN4IKdxdexnoHg91xydv1AnYqy0mrwQ3d6fAzB5MD vtRZW5p8yxsjNx3Xo6KPG+yqKLwD+xdmzmfYdqbGl6766MLfw03Ha9hcI2c1+KNa49Pa FlBwHXKql1fyrbc9+RyJpwnX8uwu3v03lNdVnSHeMY3nf0eiSDAVHDOm5C2PAxUkX9Rj lUOTvoz4JZKqRzw9tu5oT1b8sYeUzRISDaqbiWtNU94oT4HOBGCGfUWXqbzhi7vsvlqd LjcxCIDmuE745aJ/CYiEzVCBiCVRQYxbPxl7p6BqbHwCLaPjjRPLjOiIFvDIVr8n/Bk2 psMA== X-Received: by 10.43.85.4 with SMTP id am4mr5682439icc.13.1365705394953; Thu, 11 Apr 2013 11:36:34 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id dl10si300311igb.0.2013.04.11.11.36.34 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Thu, 11 Apr 2013 11:36:34 -0700 (PDT) Received: from abrestic.mtv.corp.google.com (abrestic.mtv.corp.google.com [172.22.72.111]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 4154B5A4252; Thu, 11 Apr 2013 11:36:34 -0700 (PDT) Received: by abrestic.mtv.corp.google.com (Postfix, from userid 137652) id C48BE220AF5; Thu, 11 Apr 2013 11:36:33 -0700 (PDT) From: Andrew Bresticker To: linux-fbdev@vger.kernel.org Cc: Richard Purdie , Florian Tobias Schandinat , linux-kernel@vger.kernel.org, Doug Anderson , Andrew Bresticker Subject: [PATCH] backlight: platform_lcd: introduce probe callback Date: Thu, 11 Apr 2013 11:36:31 -0700 Message-Id: <1365705391-23181-1-git-send-email-abrestic@chromium.org> X-Mailer: git-send-email 1.8.1.3 X-Gm-Message-State: ALoCoQn1AfQzjl1u84Sb2ICL1ET1MBxFzwiQik0fKZWZSUkKcEPzIq1CnTVLlKMh54GChfs9t9GJeNfIESJOl3piyT/M7mzsNB/R+Lit38T7yhHHuI4C2B+UOo1XFb3zppkHwOp/LcT/6m7P/CDLqcvfXm6GQTxe9PQaxH023QYds2EbSW3n+G0MY/BG2wJavssV9Do4+qqewCicnn+Urm81WrDROEozkA== Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Platform LCD devices may need to do some device-specific initialization before they can be used (regulator or GPIO setup, for example), but currently the driver does not support any way of doing this. This patch adds a probe() callback to plat_lcd_data which platform LCD devices can set to indicate that device-specific initialization is needed. Signed-off-by: Andrew Bresticker --- drivers/video/backlight/platform_lcd.c | 8 ++++++++ include/video/platform_lcd.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/video/backlight/platform_lcd.c b/drivers/video/backlight/platform_lcd.c index 54d94de..2fb24a1 100644 --- a/drivers/video/backlight/platform_lcd.c +++ b/drivers/video/backlight/platform_lcd.c @@ -86,6 +86,14 @@ static int platform_lcd_probe(struct platform_device *pdev) return -EINVAL; } + if (pdata->probe) { + err = pdata->probe(pdata); + if (err) { + dev_err(dev, "platform probe failed: %d\n", err); + return err; + } + } + plcd = devm_kzalloc(&pdev->dev, sizeof(struct platform_lcd), GFP_KERNEL); if (!plcd) { diff --git a/include/video/platform_lcd.h b/include/video/platform_lcd.h index ad3bdfe..23864b2 100644 --- a/include/video/platform_lcd.h +++ b/include/video/platform_lcd.h @@ -15,6 +15,7 @@ struct plat_lcd_data; struct fb_info; struct plat_lcd_data { + int (*probe)(struct plat_lcd_data *); void (*set_power)(struct plat_lcd_data *, unsigned int power); int (*match_fb)(struct plat_lcd_data *, struct fb_info *); };