From patchwork Thu Apr 11 20:24:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Bresticker X-Patchwork-Id: 2430391 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C400BDF230 for ; Thu, 11 Apr 2013 20:24:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753821Ab3DKUYy (ORCPT ); Thu, 11 Apr 2013 16:24:54 -0400 Received: from mail-vc0-f202.google.com ([209.85.220.202]:46495 "EHLO mail-vc0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752690Ab3DKUYx (ORCPT ); Thu, 11 Apr 2013 16:24:53 -0400 Received: by mail-vc0-f202.google.com with SMTP id m16so181617vca.5 for ; Thu, 11 Apr 2013 13:24:52 -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:in-reply-to :references:x-gm-message-state; bh=r71iPc45Gk0yc//aTB6p0ZnE7QXPU3JVsvBQ88Xzq3Q=; b=YGi1tr4my1MCiQ0+FF1/qa6A6qW2MvHugZSC8YeBfQMRQ4k2Znn1mq/K50sab7rilO /PNoypzZA7d6hYiy4QfqN8qkPHuXGOLqmh3xX4eivjJcGB6+0EkzmN5cZP/rtyIxz1le Q5yFgA8e6FQK6bP8zfCA8Phjc1S5jNSdbe/txWpLg2vir8l/OCkwRBCfKZUUlKYaFhCc 1QIcoyQ+Q3F5J5uZQ5lBu6flV0dD6BXVNSeKi4flQjaFwE/2v4J/EDN0rq7k84OkaG1j fI7jOorPxDEzhbzkHzyESXOHfzMBITg3hqt0xLAItcxJ4tp9Gtx0Nz5oFYKuVc3vkMAm D/sg== X-Received: by 10.236.14.233 with SMTP id d69mr2183529yhd.51.1365711892594; Thu, 11 Apr 2013 13:24:52 -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 p70si284449yhd.5.2013.04.11.13.24.52 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Thu, 11 Apr 2013 13:24:52 -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 6C1A85A42D9; Thu, 11 Apr 2013 13:24:52 -0700 (PDT) Received: by abrestic.mtv.corp.google.com (Postfix, from userid 137652) id 014E8220FCA; Thu, 11 Apr 2013 13:24:51 -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 v2] backlight: platform_lcd: introduce probe callback Date: Thu, 11 Apr 2013 13:24:50 -0700 Message-Id: <1365711890-15168-1-git-send-email-abrestic@chromium.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1365705391-23181-1-git-send-email-abrestic@chromium.org> References: <1365705391-23181-1-git-send-email-abrestic@chromium.org> X-Gm-Message-State: ALoCoQmcvaCxYxpLTGTm+nTOQbSspSiiBYcSHwjD4TwPBfGrOzQjipy7UmGOs5JzFnzg0OJjfXR2EvX2P3JjkNtuBu2wTr3LMEwQlkYEOiGPMQQBjAJXXs8I0IdBg3TZSvrd3BNQrZ32Y5smQjgzAWW7DNPUhE90sMUrnEpiKza69sYzPEnpBIRUBGpZaymnHLhRqehcH7CoSs4O+dNZ234mFPFnSpA/iQ== 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 Reviewed-by: Doug Anderson Acked-by: Jingoo Han --- drivers/video/backlight/platform_lcd.c | 6 ++++++ include/video/platform_lcd.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/video/backlight/platform_lcd.c b/drivers/video/backlight/platform_lcd.c index 17a6b83..f46180e 100644 --- a/drivers/video/backlight/platform_lcd.c +++ b/drivers/video/backlight/platform_lcd.c @@ -86,6 +86,12 @@ static int platform_lcd_probe(struct platform_device *pdev) return -EINVAL; } + if (pdata->probe) { + err = pdata->probe(pdata); + if (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 *); };