~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-sa1100/h3600.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-only
  2 /*
  3  * Support for Compaq iPAQ H3600 handheld computer
  4  *
  5  * Copyright (c) 2000,1 Compaq Computer Corporation. (Author: Jamey Hicks)
  6  * Copyright (c) 2009 Dmitry Artamonow <mad_soft@inbox.ru>
  7  */
  8 
  9 #include <linux/init.h>
 10 #include <linux/kernel.h>
 11 #include <linux/gpio.h>
 12 
 13 #include <video/sa1100fb.h>
 14 
 15 #include <asm/mach-types.h>
 16 #include <asm/mach/arch.h>
 17 
 18 #include <mach/h3xxx.h>
 19 #include <mach/irqs.h>
 20 
 21 #include "generic.h"
 22 
 23 static bool h3600_lcd_request(void)
 24 {
 25         static bool h3600_lcd_ok;
 26         int rc;
 27 
 28         if (h3600_lcd_ok)
 29                 return true;
 30 
 31         rc = gpio_request(H3XXX_EGPIO_LCD_ON, "LCD power");
 32         if (rc)
 33                 goto out;
 34         rc = gpio_direction_output(H3XXX_EGPIO_LCD_ON, 0);
 35         if (rc)
 36                 goto out_free_on;
 37         rc = gpio_request(H3600_EGPIO_LCD_PCI, "LCD control");
 38         if (rc)
 39                 goto out_free_on;
 40         rc = gpio_direction_output(H3600_EGPIO_LCD_PCI, 0);
 41         if (rc)
 42                 goto out_free_pci;
 43         rc = gpio_request(H3600_EGPIO_LCD_5V_ON, "LCD 5v");
 44         if (rc)
 45                 goto out_free_pci;
 46         rc = gpio_direction_output(H3600_EGPIO_LCD_5V_ON, 0);
 47         if (rc)
 48                 goto out_free_5v_on;
 49         rc = gpio_request(H3600_EGPIO_LVDD_ON, "LCD 9v/-6.5v");
 50         if (rc)
 51                 goto out_free_5v_on;
 52         rc = gpio_direction_output(H3600_EGPIO_LVDD_ON, 0);
 53         if (rc)
 54                 goto out_free_lvdd_on;
 55 
 56         goto out;
 57 
 58 out_free_lvdd_on:
 59         gpio_free(H3600_EGPIO_LVDD_ON);
 60 out_free_5v_on:
 61         gpio_free(H3600_EGPIO_LCD_5V_ON);
 62 out_free_pci:
 63         gpio_free(H3600_EGPIO_LCD_PCI);
 64 out_free_on:
 65         gpio_free(H3XXX_EGPIO_LCD_ON);
 66 out:
 67         if (rc)
 68                 pr_err("%s: can't request GPIOs\n", __func__);
 69         else
 70                 h3600_lcd_ok = true;
 71 
 72         return h3600_lcd_ok;
 73 }
 74 
 75 static void h3600_lcd_power(int enable)
 76 {
 77         if (!h3600_lcd_request())
 78                 return;
 79 
 80         gpio_direction_output(H3XXX_EGPIO_LCD_ON, enable);
 81         gpio_direction_output(H3600_EGPIO_LCD_PCI, enable);
 82         gpio_direction_output(H3600_EGPIO_LCD_5V_ON, enable);
 83         gpio_direction_output(H3600_EGPIO_LVDD_ON, enable);
 84 }
 85 
 86 static const struct sa1100fb_rgb h3600_rgb_16 = {
 87         .red    = { .offset = 12, .length = 4, },
 88         .green  = { .offset = 7,  .length = 4, },
 89         .blue   = { .offset = 1,  .length = 4, },
 90         .transp = { .offset = 0,  .length = 0, },
 91 };
 92 
 93 static struct sa1100fb_mach_info h3600_lcd_info = {
 94         .pixclock       = 174757,       .bpp            = 16,
 95         .xres           = 320,          .yres           = 240,
 96 
 97         .hsync_len      = 3,            .vsync_len      = 3,
 98         .left_margin    = 12,           .upper_margin   = 10,
 99         .right_margin   = 17,           .lower_margin   = 1,
100 
101         .cmap_static    = 1,
102 
103         .lccr0          = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
104         .lccr3          = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
105 
106         .rgb[RGB_16] = &h3600_rgb_16,
107 
108         .lcd_power = h3600_lcd_power,
109 };
110 
111 
112 static void __init h3600_map_io(void)
113 {
114         h3xxx_map_io();
115 }
116 
117 static void __init h3600_mach_init(void)
118 {
119         h3xxx_mach_init();
120 
121         sa11x0_register_lcd(&h3600_lcd_info);
122 }
123 
124 MACHINE_START(H3600, "Compaq iPAQ H3600")
125         .atag_offset    = 0x100,
126         .map_io         = h3600_map_io,
127         .nr_irqs        = SA1100_NR_IRQS,
128         .init_irq       = sa1100_init_irq,
129         .init_time      = sa1100_timer_init,
130         .init_machine   = h3600_mach_init,
131         .init_late      = sa11x0_init_late,
132         .restart        = sa11x0_restart,
133 MACHINE_END
134 
135 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php