rk29phone:fix building errors without wm8994
author张昊 <zhanghao@rock-chips.com>
Fri, 18 Nov 2011 03:35:57 +0000 (11:35 +0800)
committer张昊 <zhanghao@rock-chips.com>
Fri, 18 Nov 2011 03:35:57 +0000 (11:35 +0800)
arch/arm/mach-rk29/board-rk29-phonesdk.c
drivers/headset_observe/rk_headset.c
drivers/input/misc/isl29028.c
drivers/input/touchscreen/gt818_ts.c
drivers/misc/gps/rk29_gps.c
drivers/misc/mtk23d.c
drivers/video/backlight/wm831x_bl.c
include/linux/usb/android_composite.h [new file with mode: 0644]

index ac57fc82ef18701e32a58cd8468ac5967b6105b3..509fae12868e735eca2577aa5060cbf4ba1cd7ce 100755 (executable)
@@ -79,7 +79,7 @@
 #include "../../../drivers/input/touchscreen/xpt2046_cbn_ts.h"
 #endif
 #include "../../../drivers/misc/gps/rk29_gps.h"
-#include "../../../drivers/serial/sc8800.h"
+#include "../../../drivers/tty/serial/sc8800.h"
 #ifdef CONFIG_VIDEO_RK29
 /*---------------- Camera Sensor Macro Define Begin  ------------------------*/
 /*---------------- Camera Sensor Configuration Macro Begin ------------------------*/
@@ -3199,8 +3199,12 @@ static int rk29xx_virtual_keys_init(void)
 
 static void __init rk29_gic_init_irq(void)
 {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38))
+       gic_init(0, 32, (void __iomem *)RK29_GICPERI_BASE, (void __iomem *)RK29_GICCPU_BASE);
+#else
        gic_dist_init(0, (void __iomem *)RK29_GICPERI_BASE, 32);
        gic_cpu_init(0, (void __iomem *)RK29_GICCPU_BASE);
+#endif
 }
 
 static void __init machine_rk29_init_irq(void)
@@ -3312,8 +3316,11 @@ static void __init machine_rk29_mapio(void)
 
 MACHINE_START(RK29, "RK29board")
        /* UART for LL DEBUG */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37))
+       /* UART for LL DEBUG */
        .phys_io        = RK29_UART1_PHYS & 0xfff00000,
        .io_pg_offst    = ((RK29_UART1_BASE) >> 18) & 0xfffc,
+#endif
        .boot_params    = RK29_SDRAM_PHYS + 0x88000,
        .fixup          = machine_rk29_fixup,
        .map_io         = machine_rk29_mapio,
index ad99920e5e90bf138511cd1ed5742bf1684ea349..9ea5f095fc56a9ef958aecac72b213b8dbd6b56a 100755 (executable)
@@ -39,6 +39,7 @@
 #include <linux/earlysuspend.h>
 #include <linux/gpio.h>
 #include <mach/board.h>
+#include <linux/slab.h>
 
 /* Debug */
 #if 1
index 18fa05d3dfc923312a7983742d389a4eaef03a8b..055f53c5a4b1618993f4821a882e8c7af2171025 100755 (executable)
@@ -27,6 +27,7 @@
 #include <linux/circ_buf.h>
 #include <linux/interrupt.h>
 #include "isl29028.h"
+#include <linux/slab.h>
 
 #ifdef CONFIG_HAS_EARLYSUSPEND
 #include <linux/earlysuspend.h>
index 6e55be7fba177da78e57929b96e9052773104a13..5fc376435d6801b88f00e489c89cd423a9477af2 100644 (file)
@@ -834,6 +834,6 @@ late_initcall(goodix_ts_init);
 module_exit(goodix_ts_exit);\r
 \r
 MODULE_DESCRIPTION("Goodix Touchscreen Driver");\r
-MODULE_AUTHOR("hhb@rock-chips.com")\r
+MODULE_AUTHOR("hhb@rock-chips.com");\r
 MODULE_LICENSE("GPL");\r
 \r
index 0e4aa47e22ec3ba2700b563a14adf2042efccccd..a9414f3fdd542ce9d2e9b42d85933d253402cec0 100755 (executable)
@@ -248,7 +248,7 @@ static struct file_operations rk29_gps_fops = {
        .owner   = THIS_MODULE,\r
        .open    = rk29_gps_open,\r
        .read    = rk29_gps_read,\r
-       .ioctl   = rk29_gps_ioctl,\r
+       .unlocked_ioctl   = rk29_gps_ioctl,\r
        .release = rk29_gps_release,\r
 };\r
 \r
@@ -272,8 +272,8 @@ static int rk29_gps_probe(struct platform_device *pdev)
                return ret;\r
        }\r
        \r
-       init_MUTEX(&pdata->power_sem);\r
-       pdata->wq = create_freezeable_workqueue("rk29_gps");\r
+       sema_init(&pdata->power_sem,1);\r
+       pdata->wq = create_freezable_workqueue("rk29_gps");\r
        INIT_WORK(&pdata->work, rk29_gps_delay_power_downup);\r
        pdata->power_flag = 0;\r
 \r
index 14fdcdbe50d228479da6377e5326e516ec0138c1..a0fe107d3e46bb71410403a82f55202fa87cea43 100755 (executable)
@@ -23,6 +23,7 @@
 #include <linux/mtk23d.h>
 #include <linux/wakelock.h>
 #include "../mtd/rknand/api_flash.h"
+#include <linux/slab.h>
 
 MODULE_LICENSE("GPL");
 
@@ -405,7 +406,7 @@ static struct file_operations mtk23d_fops = {
        .owner = THIS_MODULE,
        .open = mtk23d_open,
        .release = mtk23d_release,
-       .ioctl = mtk23d_ioctl
+       .unlocked_ioctl = mtk23d_ioctl
 };
 
 static struct miscdevice mtk23d_misc = {
@@ -492,7 +493,7 @@ static int mtk23d_probe(struct platform_device *pdev)
 #endif 
 
        INIT_WORK(&mt6223d_data->work, bpwakeup_work_func_work);
-       init_MUTEX(&pdata->power_sem);
+       sema_init(&pdata->power_sem,1);
        power_on = 1;
        result = misc_register(&mtk23d_misc);
        if(result)
index bb8ac47c51f2176f71a52d6f1486e806f43c353b..d94845185feecce509a298a80dc343e626178c15 100755 (executable)
@@ -270,7 +270,7 @@ static int wm831x_backlight_probe(struct platform_device *pdev)
 
        props.max_brightness = max_isel;
        bl = backlight_device_register("wm831x", &pdev->dev, data,
-                                      &wm831x_backlight_ops);
+                                      &wm831x_backlight_ops,&props);
        if (IS_ERR(bl)) {
                dev_err(&pdev->dev, "failed to register backlight\n");
                kfree(data);
diff --git a/include/linux/usb/android_composite.h b/include/linux/usb/android_composite.h
new file mode 100644 (file)
index 0000000..50889ba
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Platform data for Android USB
+ *
+ * Copyright (C) 2008 Google, Inc.
+ * Author: Mike Lockwood <lockwood@android.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+#ifndef        __LINUX_USB_ANDROID_H
+#define        __LINUX_USB_ANDROID_H
+
+#include <linux/usb/composite.h>
+#include <linux/if_ether.h>
+
+struct android_usb_function {
+       struct list_head        list;
+       char                    *name;
+       int                     (*bind_config)(struct usb_configuration *c);
+};
+
+struct android_usb_product {
+       /* Default product ID. */
+       __u16 product_id;
+
+       /* List of function names associated with this product.
+        * This is used to compute the USB product ID dynamically
+        * based on which functions are enabled.
+        */
+       int num_functions;
+       char **functions;
+};
+
+struct android_usb_platform_data {
+       /* USB device descriptor fields */
+       __u16 vendor_id;
+
+       /* Default product ID. */
+       __u16 product_id;
+
+       __u16 version;
+
+       char *product_name;
+       char *manufacturer_name;
+       char *serial_number;
+
+       /* List of available USB products.
+        * This is used to compute the USB product ID dynamically
+        * based on which functions are enabled.
+        * if num_products is zero or no match can be found,
+        * we use the default product ID
+        */
+       int num_products;
+       struct android_usb_product *products;
+
+       /* List of all supported USB functions.
+        * This list is used to define the order in which
+        * the functions appear in the configuration's list of USB interfaces.
+        * This is necessary to avoid depending upon the order in which
+        * the individual function drivers are initialized.
+        */
+       int num_functions;
+       char **functions;
+};
+
+/* Platform data for "usb_mass_storage" driver. */
+struct usb_mass_storage_platform_data {
+       /* Contains values for the SC_INQUIRY SCSI command. */
+       char *vendor;
+       char *product;
+       int release;
+
+       /* number of LUNS */
+       int nluns;
+};
+
+/* Platform data for USB ethernet driver. */
+struct usb_ether_platform_data {
+       u8      ethaddr[ETH_ALEN];
+       u32     vendorID;
+       const char *vendorDescr;
+};
+
+extern void android_usb_set_connected(int on);
+
+extern void android_register_function(struct android_usb_function *f);
+
+extern void android_enable_function(struct usb_function *f, int enable);
+
+
+#endif /* __LINUX_USB_ANDROID_H */