From patchwork Sat Nov 6 16:24:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guy Martin X-Patchwork-Id: 306032 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 oA6GOrft009744 for ; Sat, 6 Nov 2010 16:24:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755424Ab0KFQYi (ORCPT ); Sat, 6 Nov 2010 12:24:38 -0400 Received: from louis.schedom-europe.net ([193.109.184.93]:41184 "EHLO louis.schedom-europe.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755408Ab0KFQYi (ORCPT ); Sat, 6 Nov 2010 12:24:38 -0400 Received: (qmail 9854 invoked by uid 507); 6 Nov 2010 17:24:36 +0100 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on louis.schedom-europe.net X-Spam-Level: *********** X-Spam-Status: No, score=11.2 required=15.0 tests=BAYES_99, FH_DATE_PAST_20XX, RCVD_IN_PBL,RDNS_DYNAMIC autolearn=disabled version=3.2.5 Received: from ip115.dyn1.liege.schedom-europe.net (HELO ibiza.bxl.tuxicoman.be) (83.101.5.115) by louis.schedom-europe.net with SMTP; 6 Nov 2010 17:24:31 +0100 Received: from borg.bxl.tuxicoman.be ([2001:6f8:310:301::1]) by ibiza.bxl.tuxicoman.be with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1PElZ7-00080M-GJ for linux-parisc@vger.kernel.org; Sat, 06 Nov 2010 17:24:29 +0100 Date: Sat, 6 Nov 2010 17:24:29 +0100 From: Guy Martin To: linux-parisc@vger.kernel.org Subject: [PATCH] parisc : KittyHawk LCD fix Message-ID: <20101106172429.5c3d1568@borg.bxl.tuxicoman.be> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 06 Nov 2010 16:24:53 +0000 (UTC) --- drivers/parisc/led.c.orig 2010-11-04 16:06:04.000000000 +0100 +++ drivers/parisc/led.c 2010-11-06 16:39:44.000000000 +0100 @@ -64,6 +64,7 @@ static unsigned int led_lanrxtx __read_mostly = 1; static char lcd_text[32] __read_mostly; static char lcd_text_default[32] __read_mostly; +static int lcd_no_led_support __read_mostly = 0; /* KittyHawk doesn't support LED on its LCD */ static struct workqueue_struct *led_wq; @@ -115,7 +116,7 @@ .lcd_width = 16, .lcd_cmd_reg_addr = KITTYHAWK_LCD_CMD, .lcd_data_reg_addr = KITTYHAWK_LCD_DATA, - .min_cmd_delay = 40, + .min_cmd_delay = 80, .reset_cmd1 = 0x80, .reset_cmd2 = 0xc0, }; @@ -135,6 +136,9 @@ /* Display the default text now */ if (led_type == LED_HASLCD) lcd_print( lcd_text_default ); + /* KittyHawk has no LED support on its LCD */ + if (lcd_no_led_support) return 0; + /* Create the work queue and queue the LED task */ led_wq = create_singlethread_workqueue("led_wq"); queue_delayed_work(led_wq, &led_task, 0); @@ -248,9 +252,13 @@ proc_pdc_root = proc_mkdir("pdc", 0); if (!proc_pdc_root) return -1; - ent = proc_create_data("led", S_IRUGO|S_IWUSR, proc_pdc_root, - &led_proc_fops, (void *)LED_NOLCD); /* LED */ - if (!ent) return -1; + + if (!lcd_no_led_support) + { + ent = proc_create_data("led", S_IRUGO|S_IWUSR, proc_pdc_root, + &led_proc_fops, (void *)LED_NOLCD); /* LED */ + if (!ent) return -1; + } if (led_type == LED_HASLCD) { @@ -692,6 +700,7 @@ case 0x58B: /* KittyHawk DC2 100 (K200) */ printk(KERN_INFO "%s: KittyHawk-Machine (hversion 0x%x) found, " "LED detection skipped.\n", __FILE__, CPU_HVERSION); + lcd_no_led_support = 1; goto found; /* use the preinitialized values of lcd_info */ }