From patchwork Fri Jun 11 10:19:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raffaele Recalcati X-Patchwork-Id: 105555 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5BAQhCY018837 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 11 Jun 2010 10:27:20 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o5BAOdj5014551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Jun 2010 05:24:39 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id o5BAOcQR024771; Fri, 11 Jun 2010 05:24:38 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 7D4088062C; Fri, 11 Jun 2010 05:24:38 -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 938D68062B for ; Fri, 11 Jun 2010 05:20:25 -0500 (CDT) Received: from neches.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id o5BAKPxV009443 for ; Fri, 11 Jun 2010 05:20:25 -0500 (CDT) Received: from psmtp.com (na3sys009amx221.postini.com [74.125.149.61]) by neches.ext.ti.com (8.13.7/8.13.7) with SMTP id o5BAKO2L012692 for ; Fri, 11 Jun 2010 05:20:24 -0500 Received: from source ([74.125.82.45]) by na3sys009amx221.postini.com ([74.125.148.13]) with SMTP; Fri, 11 Jun 2010 03:20:24 PDT Received: by mail-ww0-f45.google.com with SMTP id 13so674388wwb.4 for ; Fri, 11 Jun 2010 03:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=W7ciC3ZtnP8tQ81z/YHl6SFTmHmGWvNS9Mun4lYlyQg=; b=EDY1JYLHUCBdrtBpW1FqplfgyMoPC3y3Ei3X7QGVs3uvtX+6GLUxGi0SAWwEXUEKWP D7y0hGkYyVe8RMii1GY4NkEJlnSDqlXb+fx71jDRmkCge8wf2+FxU1iD4BDWLHtzqlCG FcJK9vxbe5IQSeVHIIvmDckr/z+ut0FrGtXhg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=fSNU04cd6Jyqonqpf71p1qVibqhVEcuVuS93xzhXSZznhr2CYlg4+2rktlAZTfKoWC VFPdu1lSthEojqmNk5Op0Hoxhd7hgyzEPgMtfAq7A4gIAu13rcXrzPdDL5VIwJIcUovA /C24Wg4zTRhilCKHIc9S1CFTHV2JVZsQJmmJY= Received: by 10.227.72.149 with SMTP id m21mr1581117wbj.165.1276251623947; Fri, 11 Jun 2010 03:20:23 -0700 (PDT) Received: from localhost.localdomain (host81-90-static.72-81-b.business.telecomitalia.it [81.72.90.81]) by mx.google.com with ESMTPS id p17sm530613wbe.14.2010.06.11.03.20.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 03:20:23 -0700 (PDT) From: Raffaele Recalcati To: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 13/14] davinci: video: davincifb Added operation in order to turn on/off hw in platform management Date: Fri, 11 Jun 2010 12:19:53 +0200 Message-Id: <1276251594-5936-13-git-send-email-lamiaposta71@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1276251594-5936-1-git-send-email-lamiaposta71@gmail.com> References: <1276251594-5936-1-git-send-email-lamiaposta71@gmail.com> X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:40.96196/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.5000) s cv gt3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] Cc: Raffaele Racalcati 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 (demeter.kernel.org [140.211.167.41]); Fri, 11 Jun 2010 10:27:20 +0000 (UTC) diff --git a/drivers/video/davincifb.c b/drivers/video/davincifb.c index dabee4d..2a7b2c9 100644 --- a/drivers/video/davincifb.c +++ b/drivers/video/davincifb.c @@ -904,6 +904,19 @@ static int davincifb_pan_display(struct fb_var_screeninfo *var, */ static int davincifb_blank(int blank_mode, struct fb_info *info) { + if (blank_mode == 4) { + dm->output_device_config(0); + dm->ops->davincifb_power(&dm->osd0->info, 0); + dm->ops->davincifb_power(&dm->osd1->info, 0); + dm->ops->davincifb_power(&dm->vid0->info, 0); + dm->ops->davincifb_power(&dm->vid1->info, 0); + } else if (!blank_mode) { + dm->output_device_config(1); + dm->ops->davincifb_power(&dm->osd0->info, 1); + dm->ops->davincifb_power(&dm->osd1->info, 1); + dm->ops->davincifb_power(&dm->vid0->info, 1); + dm->ops->davincifb_power(&dm->vid1->info, 1); + } return 0; } @@ -1416,6 +1429,10 @@ static int davincifb_remove(struct platform_device *pdev) /* Turn OFF the output device */ dm->output_device_config(0); + dm->ops->davincifb_power(&dm->osd0->info, 0); + dm->ops->davincifb_power(&dm->osd1->info, 0); + dm->ops->davincifb_power(&dm->vid0->info, 0); + dm->ops->davincifb_power(&dm->vid1->info, 0); if (dm->mmio_base) iounmap((void *)dm->mmio_base); @@ -1445,6 +1462,7 @@ static int davincifb_probe(struct platform_device *pdev) } pdata = pdev->dev.platform_data; + dm->ops = pdata->ops; /* map the regions */ dm->mmio_base = (unsigned long)ioremap(dm->mmio_base_phys, dm->mmio_size); @@ -1676,6 +1694,10 @@ static int davincifb_probe(struct platform_device *pdev) /* Turn ON the output device */ dm->output_device_config(1); + dm->ops->davincifb_power(&dm->osd0->info, 1); + dm->ops->davincifb_power(&dm->osd1->info, 1); + dm->ops->davincifb_power(&dm->vid0->info, 1); + dm->ops->davincifb_power(&dm->vid1->info, 1); return (0); diff --git a/include/video/davincifb.h b/include/video/davincifb.h index 7e4f216..c3ecdd8 100644 --- a/include/video/davincifb.h +++ b/include/video/davincifb.h @@ -439,6 +439,17 @@ struct zoom_params }; #define FBIO_SETZOOM _IOW('F', 0x24, struct zoom_params) +/* + * davincifb operations + * + * This functions are used in order to manage external hw that is platform + * dependent according to what is done on the framebuffer (turn LCD on/off, + * manage backlight, ...) + */ + +struct davincifb_ops { + int (*davincifb_power)(struct fb_info *info, int on); +}; struct davincifb_platform_data { u32 xres;