From mboxrd@z Thu Jan 1 00:00:00 1970 From: Isaac Lleida Date: Fri, 13 Mar 2015 23:20:36 +0000 Subject: [PATCH v2] staging: panel: change struct bits to a bit array Message-Id: <1426288836-25749-1-git-send-email-illeida@openaliasbox.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 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