<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Kernel on 菜菜博士</title>
    <link>https://microcai.org/tags/kernel.html</link>
    <description>Recent content in Kernel on 菜菜博士</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Sat, 09 Aug 2014 00:00:00 +0800</lastBuildDate>
    <atom:link href="https://microcai.org/tags/kernel/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>使用自己硬件的时候写的两个补丁</title>
      <link>https://microcai.org/2014/08/09/two-kernel-patch-for-my-pc.html</link>
      <pubDate>Sat, 09 Aug 2014 00:00:00 +0800</pubDate>
      <guid>https://microcai.org/2014/08/09/two-kernel-patch-for-my-pc.html</guid>
      <description>&lt;h1 id=&#34;键盘问题&#34;&gt;键盘问题&lt;/h1&gt;
&lt;p&gt;去年买了一个机械键盘。不过一直有一个困扰我的问题，就是键盘插入 USB 口后，会等待 10s 左右的时间，然后才识别。查看 dmesg 输出会看到有什么 Timeout 的。
后来发现是硬件 bug。而这种硬件 bug 是可以被内核 work-arround 的。 具体的来说就是，一个 USB-HID 插入的时候，内核会询问设备的一些特性，比如说是否支持多点触控之类的。
但是我这块键盘并不会不报告，导致内核等了大概 10s 没收到报告，于是就当你不支持咯。才继续下去。当然，除了这个该死的硬件闭口不谈外，没啥别的 bug。 所以 10秒后，键盘还是能正常使用。&lt;/p&gt;
&lt;p&gt;那么解决办法就很简单了，把这个键盘的设备 ID 添加到一个 缺陷列表， 列表文件在 drivers/hid/usbhid/hid-quirks.c 。
当然，遵循内核的设计风格，不能直接把设备 ID 这种 16 进制的数字填进去，所以在 drivers/hid/hid-ids.h 这里添加了宏定义。
补丁如下&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;  From 7af026610fe6a41426f53f3a4ea41e3aa1ee780f Mon Sep 17 00:00:00 2001
  From: microcai &amp;lt;microcaicai@gmail.com&amp;gt;
  Date: Sun, 13 Jul 2014 15:41:14 +0800
  Subject: [PATCH] HID: usbhid: add quirks for 0x04d9:0xa096 keyborad device

  I am using a USB keyborad that give me
  &amp;#34;usb_submit_urb(ctrl) failed: -1&amp;#34; error when I plugin it.
  and I need to wait for 10s for this device to be ready.

  by adding this quirks, the usb keyborad is usable right after plugin

  Signed-off-by: Wangzhao Cai &amp;lt;microcaicai@gmail.com&amp;gt;
  ---
  drivers/hid/hid-ids.h           | 1 +
  drivers/hid/usbhid/hid-quirks.c | 1 +
  2 files changed, 2 insertions(+)

  diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
  index 48b66bb..9683f6c 100644
  --- a/drivers/hid/hid-ids.h
  +++ b/drivers/hid/hid-ids.h
  @@ -479,6 +479,7 @@
  #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A070    0xa070
  #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072    0xa072
  #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081    0xa081
  +#define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096 0xa096
  
  #define USB_VENDOR_ID_IMATION          0x0718
  #define USB_DEVICE_ID_DISC_STAKKA      0xd000
  diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
  index 31e6727..e2e8b7c 100644
  --- a/drivers/hid/usbhid/hid-quirks.c
  +++ b/drivers/hid/usbhid/hid-quirks.c
  @@ -124,6 +124,7 @@ static const struct hid_blacklist {
	  { USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_HD, HID_QUIRK_NO_INIT_REPORTS },
	  { USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_QUAD_HD, HID_QUIRK_NO_INIT_REPORTS },
	  { USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_TP_V103, HID_QUIRK_NO_INIT_REPORTS },
  +       { USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096, HID_QUIRK_NO_INIT_INPUT_REPORTS | HID_QUIRK_HIDINPUT_FORCE },
  
	  { 0, 0 }
  };
  -- 
  2.0.4
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=&#34;看门狗设备问题&#34;&gt;看门狗设备问题&lt;/h1&gt;
&lt;p&gt;在 奶茶东 6/18 活动的时候，杀了一块 Z97 主板和 i7 一块回来。当然，顺便低价处理掉了原来的 P8P67 主板和 E3-1230 CPU。&lt;/p&gt;</description>
    </item>
    <item>
      <title>2.6.38.4 内核对 tq2440 支持补丁</title>
      <link>https://microcai.org/2011/04/22/patchfortq2440.html</link>
      <pubDate>Fri, 22 Apr 2011 00:00:00 +0800</pubDate>
      <guid>https://microcai.org/2011/04/22/patchfortq2440.html</guid>
      <description>&lt;p&gt;最近折腾了很久，总算搞定了。&lt;/p&gt;
&lt;p&gt;发个补丁，希望大家不要再折腾了，而且也不要看网上的所谓垃圾移植指南了，都是 bullshit.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  From 144759a9929f0858398b834a5cbfdb79ce56f077 Mon Sep 17 00:00:00 2001 
  From: microcai &amp;lt;microcai@fedoraproject.org&amp;gt; 
  Date: Sat, 30 Apr 2011 14:28:11 +0800 
  Subject: [PATCH 2/4] =TQ 2440 补丁 
  MIME-Version: 1.0 
  Content-Type: text/plain; charset=UTF-8 
  Content-Transfer-Encoding: 8bit 

  --- 
  arch/arm/mach-s3c2440/Kconfig | 46 +++ 
  arch/arm/mach-s3c2440/Makefile | 1 + 
  arch/arm/mach-s3c2440/mach-tq2440.c | 539 +++++++++++++++++++++++++++++++++++ 
  3 files changed, 586 insertions(+), 0 deletions(-) 
  create mode 100644 arch/arm/mach-s3c2440/mach-tq2440.c 

  diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig 
  index 50825a3..9afdfe5 100644 
  --- a/arch/arm/mach-s3c2440/Kconfig 
  +++ b/arch/arm/mach-s3c2440/Kconfig 
  @@ -203,4 +203,50 @@ config MACH_RX1950 
  help 
  Say Y here if you&#39;re using HP iPAQ rx1950 

  +config MACH_TQ2440 
  + bool &amp;quot;TQ 2440&amp;quot; 
  + select MACH_SMDK 
  + select CPU_S3C2440 
  + select S3C_DEV_NAND 
  + select MTD 
  + select MTD_NAND 
  + select MTD_NAND_S3C2410 
  + select S3C_DEV_USB_HOST 
  + select RTC_DRV_S3C if RTC_CLASS 
  + select S3C2410_WATCHDOG if WATCHDOG 
  + select SND_SOC_SAMSUNG_S3C24XX_UDA134X if SOUND 
  + select USB_GADGET_S3C2410 
  + select FB_S3C2410 if FB 
  + select SERIAL_SAMSUNG 
  + select SERIAL_S3C2440 
  + select SERIAL_SAMSUNG_CONSOLE 
  + select SERIO 
  + select AEABI 
  + select BINFMT_ELF 
  + select CPU_FREQ_S3C24XX if CPU_FREQ 
  + select DM9000 if NETDEVICES 
  + select DEPRECATED_PARAM_STRUCT 
  + 
  + help 
  + Say Y here if you are using the TQ 2440 Machine 
  + development system 
  + 
  +choice 
  + prompt &amp;quot;LCD size&amp;quot; 
  + default FB_S3C24X0_LCD480272 
  + depends on FB_S3C2410 &amp;amp;&amp;amp; MACH_TQ2440 
  + 
  +config FB_S3C24X0_LCD480272 
  + bool &amp;quot;4.3in LCD&amp;quot; 
  + help 
  + Support 4.3in LCD 
  + 
  + 
  +config FB_S3C24X0_TFT640480 
  + bool &amp;quot;640x480 LCD&amp;quot; 
  + 
  + 
  +endchoice 
  + 
  + 
  endmenu 
  diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile 
  index d5440fa..c001bdd 100644 
  --- a/arch/arm/mach-s3c2440/Makefile 
  +++ b/arch/arm/mach-s3c2440/Makefile 
  @@ -26,6 +26,7 @@ obj-$(CONFIG_S3C2440_PLL_16934400) += s3c2440-pll-16934400.o 

  # Machine support 

  +obj-$(CONFIG_MACH_TQ2440) += mach-tq2440.o 
  obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o 
  obj-$(CONFIG_MACH_OSIRIS) += mach-osiris.o 
  obj-$(CONFIG_MACH_RX3715) += mach-rx3715.o 
  diff --git a/arch/arm/mach-s3c2440/mach-tq2440.c b/arch/arm/mach-s3c2440/mach-tq2440.c 
  new file mode 100644 
  index 0000000..3d1bef7 
  --- /dev/null 
  +++ b/arch/arm/mach-s3c2440/mach-tq2440.c 
  @@ -0,0 +1,539 @@ 
  +/* linux/arch/arm/mach-s3c2440/mach-smdk2440.c 
  + * 
  + * Copyright (c) 2004-2005 Simtec Electronics 
  + * Ben Dooks &amp;lt;ben@simtec.co.uk&amp;gt; 
  + * 
  + * http://www.fluff.org/ben/smdk2440/ 
  + * 
  + * Thanks to Dimity Andric and TomTom for the loan of an SMDK2440. 
  + * 
  + * This program is free software; you can redistribute it and/or modify 
  + * it under the terms of the GNU General Public License version 2 as 
  + * published by the Free Software Foundation. 
  + * 
  +*/ 
  + 
  +#include &amp;lt;linux/kernel.h&amp;gt; 
  +#include &amp;lt;linux/types.h&amp;gt; 
  +#include &amp;lt;linux/interrupt.h&amp;gt; 
  +#include &amp;lt;linux/list.h&amp;gt; 
  +#include &amp;lt;linux/timer.h&amp;gt; 
  +#include &amp;lt;linux/init.h&amp;gt; 
  +#include &amp;lt;linux/serial_core.h&amp;gt; 
  +#include &amp;lt;linux/platform_device.h&amp;gt; 
  +#include &amp;lt;linux/mtd/mtd.h&amp;gt; 
  +#include &amp;lt;linux/mtd/nand.h&amp;gt; 
  +#include &amp;lt;linux/mtd/nand_ecc.h&amp;gt; 
  +#include &amp;lt;linux/mtd/partitions.h&amp;gt; 
  +#include &amp;lt;linux/i2c/at24.h&amp;gt; 
  +#include &amp;lt;linux/i2c.h&amp;gt; 
  +#include &amp;lt;linux/io.h&amp;gt; 
  +#include &amp;lt;linux/input.h&amp;gt; 
  +#include &amp;lt;linux/dm9000.h&amp;gt; 
  +#include &amp;lt;linux/gpio_keys.h&amp;gt; 
  +#include &amp;lt;linux/mmc/host.h&amp;gt; 
  +#include &amp;lt;sound/s3c24xx_uda134x.h&amp;gt; 
  + 
  +#include &amp;lt;asm/mach/arch.h&amp;gt; 
  +#include &amp;lt;asm/mach/map.h&amp;gt; 
  +#include &amp;lt;asm/mach/irq.h&amp;gt; 
  + 
  +#include &amp;lt;mach/hardware.h&amp;gt; 
  +#include &amp;lt;asm/irq.h&amp;gt; 
  +#include &amp;lt;asm/mach-types.h&amp;gt; 
  + 
  +#include &amp;lt;plat/regs-serial.h&amp;gt; 
  +#include &amp;lt;plat/regs-adc.h&amp;gt; 
  +#include &amp;lt;mach/regs-mem.h&amp;gt; 
  +#include &amp;lt;plat/iic.h&amp;gt; 
  +#include &amp;lt;plat/nand.h&amp;gt; 
  +#include &amp;lt;plat/s3c2410.h&amp;gt; 
  +#include &amp;lt;plat/s3c244x.h&amp;gt; 
  +#include &amp;lt;plat/clock.h&amp;gt; 
  +#include &amp;lt;plat/devs.h&amp;gt; 
  +#include &amp;lt;plat/cpu.h&amp;gt; 
  +#include &amp;lt;plat/udc.h&amp;gt; 
  +#include &amp;lt;plat/pm.h&amp;gt; 
  +#include &amp;lt;plat/ts.h&amp;gt; 
  +#include &amp;lt;plat/mci.h&amp;gt; 
  + 
  +#include &amp;lt;mach/fb.h&amp;gt; 
  +#include &amp;lt;mach/gpio-fns.h&amp;gt; 
  +#include &amp;lt;mach/regs-gpio.h&amp;gt; 
  +#include &amp;lt;mach/regs-lcd.h&amp;gt; 
  +#include &amp;lt;mach/leds-gpio.h&amp;gt; 
  +#include &amp;lt;mach/idle.h&amp;gt; 
  + 
  + 
  +/*NAND*/ 
  + 
  +static struct mtd_partition smdk_default_nand_part[] = { 
  + 
  + [0] = { 
  + 
  + .name = &amp;quot;uboot&amp;quot;, 
  + 
  + .offset = 0x00000000, 
  + .size = SZ_2M, 
  + 
  + }, 
  + [1] = { 
  + 
  + .name = &amp;quot;kernel&amp;quot;, 
  + .offset = SZ_2M, 
  + .size = SZ_2M + SZ_1M, 
  + }, 
  + 
  + [2] = { 
  + .name = &amp;quot;yaffs2&amp;quot;, 
  + .offset = SZ_4M+SZ_1M, 
  + .size = MTDPART_SIZ_FULL, 
  + } 
  +}; 
  + 
  +static struct s3c2410_nand_set smdk_nand_sets[] = { 
  + [0] = { 
  + .disable_ecc = 1, // 在这里设置才是正确的 
  + .name = &amp;quot;NAND&amp;quot;, 
  + .nr_chips = 1, 
  + .nr_partitions = ARRAY_SIZE(smdk_default_nand_part), 
  + .partitions = smdk_default_nand_part, 
  + }, 
  +}; 
  + 
  + 
  +static struct s3c2410_platform_nand smdk_nand_info = { 
  + .tacls = 20, 
  + .twrph0 = 60, 
  + .twrph1 = 20, 
  + .nr_sets = ARRAY_SIZE(smdk_nand_sets), 
  + .sets = smdk_nand_sets, 
  +}; 
  + 
  + 
  +/*IO*/ 
  +static struct map_desc tq2440_iodesc[] = { 
  + /* ISA IO Space map (memory space selected by A24) */ 
  + 
  + { 
  + .virtual = (u32)S3C24XX_VA_ISA_WORD, 
  + .pfn = __phys_to_pfn(S3C2410_CS2), 
  + .length = 0x10000, 
  + .type = MT_DEVICE, 
  + }, { 
  + .virtual = (u32)S3C24XX_VA_ISA_WORD + 0x10000, 
  + .pfn = __phys_to_pfn(S3C2410_CS2 + (1&amp;lt;&amp;lt;24)), 
  + .length = SZ_4M, 
  + .type = MT_DEVICE, 
  + }, { 
  + .virtual = (u32)S3C24XX_VA_ISA_BYTE, 
  + .pfn = __phys_to_pfn(S3C2410_CS2), 
  + .length = 0x10000, 
  + .type = MT_DEVICE, 
  + }, { 
  + .virtual = (u32)S3C24XX_VA_ISA_BYTE + 0x10000, 
  + .pfn = __phys_to_pfn(S3C2410_CS2 + (1&amp;lt;&amp;lt;24)), 
  + .length = SZ_4M, 
  + .type = MT_DEVICE, 
  + } 
  +}; 
  + 
  +#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK 
  +#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB 
  +#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE 
  + 
  +static struct s3c2410_uartcfg tq2440_uartcfgs[] = { 
  + [0] = { 
  + .hwport = 0, 
  + .flags = 0, 
  + .ucon = 0x3c5, 
  + .ulcon = 0x03, 
  + .ufcon = 0x51, 
  + }, 
  +}; 
  + 
  +/* LCD driver info */ 
  + 
  +static struct s3c2410fb_display tq2440_lcd_cfg = { 
  + 
  + .lcdcon5 = S3C2410_LCDCON5_FRM565 | 
  + S3C2410_LCDCON5_INVVLINE | 
  + S3C2410_LCDCON5_INVVFRAME | 
  + S3C2410_LCDCON5_PWREN | 
  + S3C2410_LCDCON5_HWSWP, 
  + 
  + .type = S3C2410_LCDCON1_TFT, 
  + 
  +#if defined(CONFIG_FB_S3C24X0_LCD480272) 
  + .width = 480, 
  + .height = 272, 
  + 
  + .pixclock = 40000, /* HCLK 100 MHz, divisor 1 */ 
  + .xres = 480, 
  + .yres = 272, 
  + .bpp = 16, 
  + .left_margin = 15, /* for HFPD*/ 
  + .right_margin = 16, /* for HBPD*/ 
  + .hsync_len = 30, /* for HSPW*/ 
  + .upper_margin = 4, /* for VFPD*/ 
  + .lower_margin = 2, /* for VBPD*/ 
  + .vsync_len = 8, /* for VSPW*/ 
  + 
  +#elif defined(CONFIG_FB_S3C24X0_TFT640480) 
  + .width = 640, 
  + .height = 480, 
  + 
  + .pixclock = 40000, /* HCLK 100 MHz, divisor 1 */ 
  + .xres = 640, 
  + .yres = 480, 
  + .bpp = 16, 
  + .left_margin = 40, /* for HFPD*/ 
  + .right_margin = 67, /* for HBPD*/ 
  + .hsync_len = 31, /* for HSPW*/ 
  + .upper_margin = 5, /* for VFPD*/ 
  + .lower_margin = 25, /* for VBPD*/ 
  + .vsync_len = 1, /* for VSPW*/ 
  + 
  +#else 
  + .width = 240, 
  + .height = 320, 
  + 
  + .pixclock = 166667, /* HCLK 60 MHz, divisor 10 */ 
  + .xres = 240, 
  + .yres = 320, 
  + .bpp = 16, 
  + .left_margin = 20, 
  + .right_margin = 8, 
  + .hsync_len = 4, 
  + .upper_margin = 8, 
  + .lower_margin = 7, 
  + .vsync_len = 4, 
  +#endif 
  + 
  +}; 
  + 
  +static struct s3c2410fb_mach_info tq2440_fb_info = { 
  + .displays = &amp;amp;tq2440_lcd_cfg, 
  + .num_displays = 1, 
  + .default_display = 0, 
  +}; 
  + 
  + 
  +static struct resource s3c_dm9000_resource[] = { 
  + [0] = { 
  + .start = S3C2410_CS4, 
  + .end = S3C2410_CS4+3, 
  + .flags = IORESOURCE_MEM, 
  + }, 
  + 
  + [1] = { 
  + .start = S3C2410_CS4+4, 
  + .end = S3C2410_CS4+4+3, 
  + .flags = IORESOURCE_MEM, 
  + }, 
  + 
  + [2] = { 
  + .start = IRQ_EINT7, 
  + .end =IRQ_EINT7, 
  + .flags =IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHEDGE|IORESOURCE_IRQ_SHAREABLE, 
  + } 
  +}; 
  + 
  +static struct dm9000_plat_data dm9k_plat_data = { 
  + .flags = DM9000_PLATF_16BITONLY|DM9000_PLATF_NO_EEPROM, 
  + .dev_addr = &amp;quot;&amp;quot;, 
  + }; 
  + 
  +static struct platform_device s3c_device_dm9k = { 
  + .name = &amp;quot;dm9000&amp;quot;, 
  + .id = 0, 
  + .num_resources = ARRAY_SIZE(s3c_dm9000_resource), 
  + .resource = s3c_dm9000_resource, 
  + .dev = { 
  + .platform_data = &amp;amp;dm9k_plat_data, 
  + } 
  +}; 
  + 
  + 
  +/*设置udc回调函数udc_pullup()用于使能/禁止UDC上拉电阻*/ 
  +/*udc*/ 
  +static void udc_pullup(enum s3c2410_udc_cmd_e cmd) 
  +{ 
  + switch(cmd) 
  + { 
  + case S3C2410_UDC_P_ENABLE: 
  + s3c2410_gpio_setpin(S3C2410_GPG(12),1); 
  + break; 
  + case S3C2410_UDC_P_DISABLE: 
  + s3c2410_gpio_setpin(S3C2410_GPG(12),0); 
  + break; 
  + case S3C2410_UDC_P_RESET: 
  + break; 
  + default: 
  + break; 
  + } 
  +} 
  +static struct s3c2410_udc_mach_info udc_machine = { 
  + .udc_command = udc_pullup, 
  +}; 
  + 
  + 
  +/*KEY*/ 
  +static struct gpio_keys_button mini2440_buttons[] = { 
  + { 
  + .gpio = S3C2410_GPF(1), /* K1 */ 
  + .code = KEY_UP, 
  + .desc = &amp;quot;UP&amp;quot;, 
  + .active_low = 1, 
  + }, 
  + { 
  + .gpio = S3C2410_GPF(4), /* K2 */ 
  + .code = KEY_DOWN, 
  + .desc = &amp;quot;DOWN&amp;quot;, 
  + .active_low = 1, 
  + }, 
  + { 
  + .gpio = S3C2410_GPF(2), /* K3 */ 
  + .code = KEY_LEFT, 
  + .desc = &amp;quot;LEFT&amp;quot;, 
  + .active_low = 1, 
  + }, 
  + { 
  + .gpio = S3C2410_GPF(0), /* K4 */ 
  + .code = KEY_RIGHT, 
  + .desc = &amp;quot;RIGHT&amp;quot;, 
  + .active_low = 1, 
  + }, 
  + 
  +}; 
  + 
  +static struct gpio_keys_platform_data mini2440_button_data = { 
  + .buttons = mini2440_buttons, 
  + .nbuttons = ARRAY_SIZE(mini2440_buttons), 
  +}; 
  + 
  +static struct platform_device mini2440_button_device = { 
  + .name = &amp;quot;gpio-keys&amp;quot;, 
  + .id = -1, 
  + .dev = { 
  + .platform_data = &amp;amp;mini2440_button_data, 
  + } 
  +}; 
  + 
  +/* LED devices */ 
  + 
  +static struct s3c24xx_led_platdata smdk_pdata_led4 = { 
  + .gpio = S3C2410_GPB(5), 
  + .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 
  + .name = &amp;quot;led4&amp;quot;, 
  + .def_trigger = &amp;quot;timer&amp;quot;, 
  +}; 
  + 
  +static struct s3c24xx_led_platdata smdk_pdata_led5 = { 
  + .gpio = S3C2410_GPB(6), 
  + .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 
  + .name = &amp;quot;led5&amp;quot;, 
  + .def_trigger = &amp;quot;nand-disk&amp;quot;, 
  +}; 
  + 
  +static struct s3c24xx_led_platdata smdk_pdata_led6 = { 
  + .gpio = S3C2410_GPB(7), 
  + .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 
  + .name = &amp;quot;led6&amp;quot;, 
  +}; 
  + 
  +static struct s3c24xx_led_platdata smdk_pdata_led7 = { 
  + .gpio = S3C2410_GPB(8), 
  + .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 
  + .name = &amp;quot;led7&amp;quot;, 
  +}; 
  + 
  +static struct platform_device smdk_led4 = { 
  + .name = &amp;quot;s3c24xx_led&amp;quot;, 
  + .id = 0, 
  + .dev = { 
  + .platform_data = &amp;amp;smdk_pdata_led4, 
  + }, 
  +}; 
  + 
  +static struct platform_device smdk_led5 = { 
  + .name = &amp;quot;s3c24xx_led&amp;quot;, 
  + .id = 1, 
  + .dev = { 
  + .platform_data = &amp;amp;smdk_pdata_led5, 
  + }, 
  +}; 
  + 
  +static struct platform_device smdk_led6 = { 
  + .name = &amp;quot;s3c24xx_led&amp;quot;, 
  + .id = 2, 
  + .dev = { 
  + .platform_data = &amp;amp;smdk_pdata_led6, 
  + }, 
  +}; 
  + 
  +static struct platform_device smdk_led7 = { 
  + .name = &amp;quot;s3c24xx_led&amp;quot;, 
  + .id = 3, 
  + .dev = { 
  + .platform_data = &amp;amp;smdk_pdata_led7, 
  + }, 
  +}; 
  + 
  +static struct s3c24xx_uda134x_platform_data tq2440_audio_pins = { 
  + .l3_clk = S3C2410_GPB(4), 
  + .l3_data = S3C2410_GPB(3), 
  + .l3_mode = S3C2410_GPB(2), 
  + .model = UDA134X_UDA1341, 
  +}; 
  + 
  +static struct platform_device tq2440_audio = { 
  + .name = &amp;quot;s3c24xx_uda134x&amp;quot;, 
  + .id = 0, 
  + .dev = { 
  + .platform_data = &amp;amp;tq2440_audio_pins, 
  + }, 
  +}; 
  + 
  +static struct platform_device uda1340_codec = { 
  + .name = &amp;quot;uda134x-codec&amp;quot;, 
  +}; 
  + 
  +/* Touchscreen */ 
  +static struct s3c2410_ts_mach_info tq2400_ts_info = { 
  + .delay = 10000, 
  + .presc = 49, 
  + .oversampling_shift = 2, 
  +}; 
  + 
  +static struct resource s3c_adc_resource[] = { 
  + [0] = { 
  + .start = S3C2410_PA_ADC, 
  + .end = S3C2410_PA_ADC + 0x20 , 
  + .flags = IORESOURCE_MEM, 
  + }, 
  + [1] = { 
  + .start = IRQ_TC, 
  + .end = IRQ_TC, 
  + .flags = IORESOURCE_IRQ, 
  + }, 
  + [2] = { 
  + .start = IRQ_ADC, 
  + .end = IRQ_ADC, 
  + .flags = IORESOURCE_IRQ, 
  + }, 
  +}; 
  + 
  + 
  +/* 
  + * I2C devices 
  + */ 
  +static struct at24_platform_data at24c08 = { 
  + .byte_len = SZ_8K / 8, 
  + .page_size = 16, 
  +}; 
  + 
  +static struct i2c_board_info mini2440_i2c_devs[] = { 
  + { 
  + I2C_BOARD_INFO(&amp;quot;24c08&amp;quot;, 0x50), 
  + .platform_data = &amp;amp;at24c08, 
  + }, 
  +}; 
  + 
  + 
  +static struct platform_device *tq2440_devices[] = { 
  + &amp;amp;s3c_device_adc, 
  + &amp;amp;s3c_device_ts, 
  + &amp;amp;s3c_device_ohci, // s3c24xx_ohci 
  + &amp;amp;s3c_device_wdt, // 看门狗狗 
  + &amp;amp;s3c_device_lcd, 
  + &amp;amp;s3c_device_i2c0, 
  + &amp;amp;s3c_device_iis, 
  + &amp;amp;s3c_device_nand, // MTD NAND 分区表 
  + &amp;amp;s3c_device_dm9k, // 特别的DM9000网卡芯片 
  + &amp;amp;s3c_device_rtc, 
  + &amp;amp;mini2440_button_device, 
  + &amp;amp;s3c_device_sdi, // SD 卡读卡器 
  + &amp;amp;s3c_device_usbgadget, 
  + &amp;amp;uda1340_codec, 
  + &amp;amp;tq2440_audio, // ALSA 声卡 
  + &amp;amp;samsung_asoc_dma, 
  + &amp;amp;smdk_led4, 
  + &amp;amp;smdk_led5, 
  + &amp;amp;smdk_led6, 
  + &amp;amp;smdk_led7, 
  +}; 
  + 
  +/* MMC/SD */ 
  + 
  +static struct s3c24xx_mci_pdata mini2440_mmc_cfg = { 
  + .gpio_detect = S3C2410_GPG(8), 
  + .gpio_wprotect = S3C2410_GPH(8), 
  + .set_power = NULL, 
  + .ocr_avail = MMC_VDD_32_33|MMC_VDD_33_34, 
  +}; 
  + 
  +static void __init tq2440_map_io(void) 
  +{ 
  + s3c24xx_init_io(tq2440_iodesc, ARRAY_SIZE(tq2440_iodesc)); 
  + s3c24xx_init_clocks(12000000); 
  + s3c24xx_init_uarts(tq2440_uartcfgs, ARRAY_SIZE(tq2440_uartcfgs)); 
  +} 
  + 
  +static void __init tq2440_machine_init(void) 
  +{ 
  + int i; 
  + 
  + s3c24xx_fb_set_platdata(&amp;amp;tq2440_fb_info); 
  + s3c_i2c0_set_platdata(NULL); 
  + 
  + s3c2410_gpio_cfgpin(S3C2410_GPG(8),S3C2410_GPG8_EINT16); 
  + 
  + s3c_nand_set_platdata(&amp;amp;smdk_nand_info); 
  + s3c24xx_mci_set_platdata(&amp;amp;mini2440_mmc_cfg); 
  + 
  +// s3c_device_adc.num_resources = ARRAY_SIZE(s3c_adc_resource); 
  +// s3c_device_adc.resource = s3c_adc_resource; 
  + 
  + s3c_device_ts.dev.platform_data = &amp;amp;tq2400_ts_info; 
  + 
  + 
  +#ifdef CONFIG_DM9000 
  + *((volatile unsigned int *)S3C2410_BANKCON4) = 0x1f7c; //config time seq 
  +#endif 
  + 
  + /* mark the key as input, without pullups (there is one on the board) */ 
  + for ( i = 0; i &amp;lt; ARRAY_SIZE(mini2440_buttons); i++) { 
  + s3c_gpio_setpull(mini2440_buttons[i].gpio, S3C_GPIO_PULL_UP); 
  + s3c_gpio_cfgpin(mini2440_buttons[i].gpio, S3C2410_GPIO_INPUT); 
  + } 
  + 
  + s3c24xx_mci_set_platdata(&amp;amp;mini2440_mmc_cfg); 
  + 
  + i2c_register_board_info(0, mini2440_i2c_devs, 
  + ARRAY_SIZE(mini2440_i2c_devs)); 
  + 
  + platform_add_devices(tq2440_devices, ARRAY_SIZE(tq2440_devices)); 
  + 
  + s3c2410_gpio_setpin(S3C2410_GPG(12),0); 
  + s3c2410_gpio_cfgpin(S3C2410_GPG(12),S3C2410_GPIO_OUTPUT); 
  + s3c24xx_udc_set_platdata(&amp;amp;udc_machine); 
  +} 
  + 
  +#define MACH_TYPE_168 168 
  +/*For some reason , my machine is ID 168*/ 
  +MACHINE_START(168, &amp;quot;TQ2440-168&amp;quot;) 
  + .boot_params = S3C2410_SDRAM_PA + 0x100, 
  + .init_irq = s3c24xx_init_irq, 
  + .map_io = tq2440_map_io, 
  + .init_machine = tq2440_machine_init, 
  + .timer = &amp;amp;s3c24xx_timer, 
  +MACHINE_END 
  + 
  +MACHINE_START(TQ2440, &amp;quot;TQ2440&amp;quot;) 
  + .boot_params = S3C2410_SDRAM_PA + 0x100, 
  + .init_irq = s3c24xx_init_irq, 
  + .map_io = tq2440_map_io, 
  + .init_machine = tq2440_machine_init, 
  + .timer = &amp;amp;s3c24xx_timer, 
  +MACHINE_END 
  -- 
  1.7.5.rc3 

  From 119021354fa6001311db9f1df5d3ea8061a35f9b Mon Sep 17 00:00:00 2001 
  From: microcai &amp;lt;microcai@fedoraproject.org&amp;gt; 
  Date: Thu, 5 May 2011 14:40:44 +0800 
  Subject: [PATCH 3/4] add report for ABS_PRESSURE, this fix tslib problem that 
  not been able to detect pen-down and pen-up events. 

  --- 
  drivers/input/touchscreen/s3c2410_ts.c | 3 +++ 
  1 files changed, 3 insertions(+), 0 deletions(-) 

  diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c 
  index 8feb7f3..ecab5d4 100644 
  --- a/drivers/input/touchscreen/s3c2410_ts.c 
  +++ b/drivers/input/touchscreen/s3c2410_ts.c 
  @@ -126,6 +126,7 @@ static void touch_timer_fire(unsigned long data) 
  input_report_abs(ts.input, ABS_Y, ts.yp); 

  input_report_key(ts.input, BTN_TOUCH, 1); 
  + input_report_abs(ts.input, ABS_PRESSURE, 1); 
  input_sync(ts.input); 

  ts.xp = 0; 
  @@ -140,6 +141,7 @@ static void touch_timer_fire(unsigned long data) 
  ts.count = 0; 

  input_report_key(ts.input, BTN_TOUCH, 0); 
  + input_report_abs(ts.input, ABS_PRESSURE, 0); 
  input_sync(ts.input); 

  writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC); 
  @@ -318,6 +320,7 @@ static int __devinit s3c2410ts_probe(struct platform_device *pdev) 
  ts.input-&amp;gt;keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); 
  input_set_abs_params(ts.input, ABS_X, 0, 0x3FF, 0, 0); 
  input_set_abs_params(ts.input, ABS_Y, 0, 0x3FF, 0, 0); 
  + input_set_abs_params(ts.input, ABS_PRESSURE, 0, 1, 0, 0); 

  ts.input-&amp;gt;name = &amp;quot;S3C24XX TouchScreen&amp;quot;; 
  ts.input-&amp;gt;id.bustype = BUS_HOST; 
  -- 
  1.7.5.rc3 

  From 4684013358b6edf0e8a790ef32de13a236cf7987 Mon Sep 17 00:00:00 2001 
  From: microcai &amp;lt;microcai@fedoraproject.org&amp;gt; 
  Date: Thu, 5 May 2011 16:19:53 +0800 
  Subject: [PATCH 4/4] fix some time later then driver not response 

  --- 
  drivers/input/touchscreen/s3c2410_ts.c | 1 + 
  1 files changed, 1 insertions(+), 0 deletions(-) 

  diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c 
  index ecab5d4..db868d2 100644 
  --- a/drivers/input/touchscreen/s3c2410_ts.c 
  +++ b/drivers/input/touchscreen/s3c2410_ts.c 
  @@ -227,6 +227,7 @@ static void s3c24xx_ts_select(struct s3c_adc_client *client, unsigned select) 
  if (select) { 
  writel(S3C2410_ADCTSC_PULL_UP_DISABLE | AUTOPST, 
  ts.io + S3C2410_ADCTSC); 
  + writel(readl(ts.io+S3C2410_ADCCON) | S3C2410_ADCCON_ENABLE_START, ts.io+S3C2410_ADCCON); 
  } else { 
  mod_timer(&amp;amp;touch_timer, jiffies+1); 
  writel(WAIT4INT | INT_UP, ts.io + S3C2410_ADCTSC); 
  -- 
  1.7.5.rc3
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>in-kernel UNICODE font support for fbcon</title>
      <link>https://microcai.org/2011/01/01/cjktty.html</link>
      <pubDate>Sat, 01 Jan 2011 00:00:00 +0800</pubDate>
      <guid>https://microcai.org/2011/01/01/cjktty.html</guid>
      <description>&lt;p&gt;I first got this patch from 内核补丁：字符终端显示UTF-8字符串&lt;/p&gt;
&lt;p&gt;but , there is some problems &amp;hellip;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;why not extending kernel VGA font to support UNICODE?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;why so many duplicated code ? too many copy&amp;amp;past,  Linus
won&amp;rsquo;t take this patch&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Why all char  &amp;gt; 127 should be double-weight ?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I need to use setfont to set UNICODE font, with this patch,
I can&amp;rsquo;t. So , I made some changes &amp;hellip;
to eliminate all problems above.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;</description>
    </item>
    <item>
      <title>内核TTY控制台的问题</title>
      <link>https://microcai.org/2010/12/28/ttyproblem.html</link>
      <pubDate>Tue, 28 Dec 2010 00:00:00 +0800</pubDate>
      <guid>https://microcai.org/2010/12/28/ttyproblem.html</guid>
      <description>&lt;p&gt;最近因为编写TTY控制台的UNICODE字体支持补丁，拜读了控制台的代码，诶，妈呀，这个是什么代码哟 &amp;hellip;&amp;hellip;&lt;/p&gt;
&lt;p&gt;TTY 控制台最开始的时候是使用 VGA 显卡的 TEXT模式的。 VGA TEXT 模式有个非常特别的地方就是，显存被映射到了一个固定的位置, 大约接近  1MB 的下方。 两个字节一对。第一个字节指示下一个字节的属性。第二个字节指示一个字符 index. 而这个字符表包含了 255 个字符，在 Windows 中， 这个字符集被称做 OEM codepage, 前127个字符和 ASCII 是一样的. 这样只要向对应的地址写入字符属性和字符的代码，就可以在对应的屏幕位置显示出对于的文字。这TTY 控制台就依据 VGA 字符模式写开了。每个 tty 终端都对应一个结构体。&lt;/p&gt;
&lt;p&gt;这个结构体里有一个 vc_screenbuf 的成员，里面就是按照 VGA text 模式保存的整个屏幕的字符。切换终端的时候，就是一个 memcpy 把这个地方的字符拷贝到显存里，就完成了终端显示的切换。&lt;/p&gt;
&lt;p&gt;问题就出在这里。vc_screenbuf 完全是依据 VGA Text 模式设置的。哪里有地方给你保存 UNICODE 编码啊，只有 255 个字符哦 &amp;hellip;&amp;hellip;&lt;/p&gt;
&lt;p&gt;直接改成  32bit/32bit pair 不就行了？&lt;/p&gt;
&lt;p&gt;NO&lt;del&gt;NO&lt;/del&gt;NO&lt;del&gt;NO&lt;/del&gt;&lt;/p&gt;
&lt;p&gt;不行！ 因为完全和 TTY 无关的别的代码都已经按照现行的结构来写了，这样一改就会大动干戈, 改掉很多很多不是控制台部分的代码。而且，控制台其他部分的代码，也都是直接按照这种格式去操作的，完全没有用宏去封装，改起来难度非常大。&lt;/p&gt;
&lt;p&gt;我曾经花了2天时间去做这种改动。修改了超过一千行代码 &amp;hellip; 结果 &amp;hellip; 还是改不动。
太多地方已经很顽固的假设这种布局了。&lt;/p&gt;
&lt;p&gt;那么，把 字符和属性分开？ textbuf 和 attrbuf ? 其实就相当于重写。
我也花了2天时间这么搞 .. 结果 tty 部分的代码终于改好了，结果发现内核的很多其他部分也要修改 &amp;hellip; &amp;hellip;&lt;/p&gt;</description>
    </item>
    <item>
      <title>内核要集成glibc么</title>
      <link>https://microcai.org/2010/12/24/libcinkernel.html</link>
      <pubDate>Fri, 24 Dec 2010 00:00:00 +0800</pubDate>
      <guid>https://microcai.org/2010/12/24/libcinkernel.html</guid>
      <description>&lt;p&gt;往往内核添加了一个功能， glibc 要花很久才会用上。本来linux 那边为这个功能是否进入内核已经吵半天了，glibc
这边又要为是否使用这个内核新特性再次吵架半天 (glibc 不是 Linux 专有的，还得考虑 BSD (虽然人家也不用 glibc)
SysV Windows(诶，这没办法) ， 还有 sun 那消亡的 *** , 还有, 自家的 Hurd  wink.gif
然后，总之，这样新特性让人的接受上。。。 太慢了。&lt;/p&gt;
&lt;p&gt;说近点的，fnotify glibc还没有对应的包装函数呢，futex 和 NPTL 又是花了许久才进入主流的。libc 是 app
和内核的桥梁，libc 理应快速跟上内核的接口变化 .. 但是 &amp;hellip; &amp;hellip; glibc 和 内核不是一块开发的，所以，这只是理想罢了。
glibc 还要去兼容不同版本的内核呢！
而内核也要去兼容不同版本的 glibc . 双方都背负了太多的历史包袱。glibc 至今保留 LinuxThreads
兼容2.4版本的古老内核。Linux
对已经没用，甚至有bug（接口的问题导致一些bug是必须的）的系统调用也必须保留，随知道用户会用哪个版本的glibc呢？虽然新的glibc
会使用新的调用，但是提供和老的调用一致的 API 来兼容，但是，用户只升级内核而不升级 glibc 是常有的事情. .. 就算升级了
glibc &amp;hellip; 你新版本的 glibc 一定就用上内核的新接口？！？！？！？！ 还是再等几年等 glibc 的开发者吵架结束吧&lt;/p&gt;
&lt;p&gt;于是乎，Linux 的大牛们再次使出绝招： 让 libc 变成 VDSO 进驻内核。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
