From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755007AbbCMXaE (ORCPT ); Fri, 13 Mar 2015 19:30:04 -0400 Received: from mail2.openmailbox.org ([62.4.1.33]:60728 "EHLO mail2.openmailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752047AbbCMXaA (ORCPT ); Fri, 13 Mar 2015 19:30:00 -0400 X-Greylist: delayed 546 seconds by postgrey-1.27 at vger.kernel.org; Fri, 13 Mar 2015 19:29:59 EDT From: Isaac Lleida To: willy@meta-x.org Cc: gregkh@linuxfoundation.org, marius.gorski@gmail.com, armand.bastien@laposte.net, domdevlin@free.fr, sudipm.mukherjee@gmail.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Isaac Lleida Subject: [PATCH v2] staging: panel: change struct bits to a bit array Date: Sat, 14 Mar 2015 00:20:36 +0100 Message-Id: <1426288836-25749-1-git-send-email-illeida@openaliasbox.org> X-Mailer: git-send-email 2.3.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This path implements a bit array representing the LCD signal states instead of the old "struct bits", which used char to represent a single bit. This will reduce the memory usage. Signed-off-by: Isaac Lleida >= 1; @@ -814,7 +826,7 @@ static void lcd_backlight(int on) /* The backlight is activated by setting the AUTOFEED line to +5V */ spin_lock_irq(&pprt_lock); - bits.bl = on; + BIT_MOD(bits, LCD_BIT_BL_MASK, on); panel_set_bits(); spin_unlock_irq(&pprt_lock); } @@ -849,14 +861,14 @@ static void lcd_write_cmd_p8(int cmd) w_dtr(pprt, cmd); udelay(20); /* maintain the data during 20 us before the strobe */ - bits.e = BIT_SET; - bits.rs = BIT_CLR; - bits.rw = BIT_CLR; + BIT_ON(bits, LCD_BIT_E_MASK); + BIT_ON(bits, LCD_BIT_RS_MASK); + BIT_OFF(bits, LCD_BIT_RW_MASK); set_ctrl_bits(); udelay(40); /* maintain the strobe during 40 us */ - bits.e = BIT_CLR; + BIT_OFF(bits, LCD_BIT_E_MASK); set_ctrl_bits(); udelay(120); /* the shortest command takes at least 120 us */ @@ -871,14 +883,14 @@ static void lcd_write_data_p8(int data) w_dtr(pprt, data); udelay(20); /* maintain the data during 20 us before the strobe */ - bits.e = BIT_SET; - bits.rs = BIT_SET; - bits.rw = BIT_CLR; + BIT_ON(bits, LCD_BIT_E_MASK); + BIT_ON(bits, LCD_BIT_RS_MASK); + BIT_OFF(bits, LCD_BIT_RW_MASK); set_ctrl_bits(); udelay(40); /* maintain the strobe during 40 us */ - bits.e = BIT_CLR; + BIT_OFF(bits, LCD_BIT_E_MASK); set_ctrl_bits(); udelay(45); /* the shortest data takes at least 45 us */ @@ -968,15 +980,15 @@ static void lcd_clear_fast_p8(void) /* maintain the data during 20 us before the strobe */ udelay(20); - bits.e = BIT_SET; - bits.rs = BIT_SET; - bits.rw = BIT_CLR; + BIT_ON(bits, LCD_BIT_E_MASK); + BIT_OFF(bits, LCD_BIT_RS_MASK); + BIT_OFF(bits, LCD_BIT_RW_MASK); set_ctrl_bits(); /* maintain the strobe during 40 us */ udelay(40); - bits.e = BIT_CLR; + BIT_OFF(bits, LCD_BIT_E_MASK); set_ctrl_bits(); /* the shortest data takes at least 45 us */ -- 2.3.2