From patchwork Wed Jan 12 22:14:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Charkov X-Patchwork-Id: 475111 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0CMEpq3026806 for ; Wed, 12 Jan 2011 22:14:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751484Ab1ALWOv (ORCPT ); Wed, 12 Jan 2011 17:14:51 -0500 Received: from mail-ey0-f174.google.com ([209.85.215.174]:48785 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751049Ab1ALWOu (ORCPT ); Wed, 12 Jan 2011 17:14:50 -0500 Received: by eye27 with SMTP id 27so563366eye.19 for ; Wed, 12 Jan 2011 14:14:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=VSiblp9dQ4pOkZWqWI9eMLIqRn+TPSixMTvJ8GzYHGw=; b=ky3/BrebU9cVRHTPPedMmNDD6jSYdbfSB8wm4oaAU4zh7/nblAP2goxGKouJiXlR9h mvzvHEJ7STiSQqtfBwJTVs9RzN27bsN4GKY+WO8sq8/BhZ4Om/QZwrXf0/Eh2wm8UohU RT3Tbp6l6gm1fIumRmgXxr1niaWbqeRsNG9Jw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=sjP1C2EsbmyxXFtrjIOOc2O9n8U5olLXCHQ5TNEn0J8rUzMkCuZXS6PgtSDkaS3Br4 K+HflUXRe4L+DChdG8aaOicy7Frhoz/sMUlEhEPohOTgE2EURRXAE9EQlS4xLXv5RCYK N4PKgMkCPllEBHmElTzEw5hfAGdvl2BvOkiZY= Received: by 10.213.114.81 with SMTP id d17mr1758429ebq.28.1294870488651; Wed, 12 Jan 2011 14:14:48 -0800 (PST) Received: from localhost ([178.177.200.91]) by mx.google.com with ESMTPS id t50sm860706eeh.12.2011.01.12.14.14.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 12 Jan 2011 14:14:48 -0800 (PST) Date: Thu, 13 Jan 2011 01:14:44 +0300 From: Alexey Charkov To: Paul Mundt Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, vt8500-wm8505-linux-kernel@googlegroups.com Subject: [PATCH] fbdev: Implement simple blanking in pseudocolor modes for vt8500lcdfb Message-ID: <20110112221443.GA574@alchark-u3s> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 12 Jan 2011 22:14:51 +0000 (UTC) diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c index 7617f12..0e120d6 100644 --- a/drivers/video/vt8500lcdfb.c +++ b/drivers/video/vt8500lcdfb.c @@ -215,6 +215,33 @@ static int vt8500lcd_pan_display(struct fb_var_screeninfo *var, return 0; } +/* + * vt8500lcd_blank(): + * Blank the display by setting all palette values to zero. Note, + * True Color modes do not really use the palette, so this will not + * blank the display in all modes. + */ +static int vt8500lcd_blank(int blank, struct fb_info *info) +{ + int i; + + switch (blank) { + case FB_BLANK_POWERDOWN: + case FB_BLANK_VSYNC_SUSPEND: + case FB_BLANK_HSYNC_SUSPEND: + case FB_BLANK_NORMAL: + if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR || + info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) + for (i = 0; i < 256; i++) + vt8500lcd_setcolreg(i, 0, 0, 0, 0, info); + case FB_BLANK_UNBLANK: + if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR || + info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) + fb_set_cmap(&info->cmap, info); + } + return 0; +} + static struct fb_ops vt8500lcd_ops = { .owner = THIS_MODULE, .fb_set_par = vt8500lcd_set_par, @@ -225,6 +252,7 @@ static struct fb_ops vt8500lcd_ops = { .fb_sync = wmt_ge_sync, .fb_ioctl = vt8500lcd_ioctl, .fb_pan_display = vt8500lcd_pan_display, + .fb_blank = vt8500lcd_blank, }; static irqreturn_t vt8500lcd_handle_irq(int irq, void *dev_id)