Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <linux/module.h>
- #include <linux/kernel.h>
- #include <linux/types.h>
- #include <linux/list.h>
- #include <linux/err.h>
- #include <linux/platform_device.h>
- #include <linux/i2c.h>
- #include <linux/i2c-gpio.h>
- #include <linux/gpio_event.h>
- #include <linux/keyreset.h>
- #include <mach/gpio.h>
- #include <mach/vreg.h>
- #include <mach/board.h>
- #include <mach/board_lge.h>
- #include <mach/rpc_server_handset.h>
- #include <mach/pmic.h>
- #include "proc_comm.h"
- #include "board-thunderg.h"
- static struct i2c_board_info wm9090_i2c_bdinfo[] = {
- [0] = {
- I2C_BOARD_INFO("wm9090", 0x6e),//PROXI_I2C_ADDRESS),
- .type = "wm9090",
- // .platform_data = &proxi_pdata,
- },
- };
- static struct gpio_i2c_pin wm9090_i2c_pin[] = {
- [0] = {
- .sda_pin = 17, //AUDIO&MOTION_I2C_SDA
- .scl_pin = 27, //AUDIO&MOTION_I2C_SCL
- // .reset_pin = 0,
- // .irq_pin = PROXI_GPIO_DOUT,
- },
- };
- static struct i2c_gpio_platform_data wm9090_i2c_pdata = {
- .sda_is_open_drain = 1, // 0
- .scl_is_open_drain = 1, // 0
- .udelay = 2,
- };
- static struct platform_device wm9090_i2c_device = {
- .name = "i2c-gpio",
- .dev.platform_data = &wm9090_i2c_pdata,
- };
- static void __init thunderg_init_i2c_wm9090(int bus_num)
- {
- wm9090_i2c_device.id = bus_num;
- init_gpio_i2c_pin(&wm9090_i2c_pdata, wm9090_i2c_pin[0], &wm9090_i2c_bdinfo[0]);
- i2c_register_board_info(bus_num, &wm9090_i2c_bdinfo[0], 1);
- platform_device_register(&wm9090_i2c_device);
- }
- static int __init i2c_wm9093_init(void)
- {
- printk("I2C WM9093 Test");
- thunderg_init_i2c_wm9090(6);
- //lge_add_gpio_i2c_device(thunderg_init_i2c_wm9090);
- //return platform_driver_register(&gpio_h2w_driver);
- return 0;
- }
- static void __exit i2c_wm9093_exit(void)
- {
- //platform_driver_unregister(&gpio_h2w_driver);
- }
- module_init(i2c_wm9093_init);
- module_exit(i2c_wm9093_exit);
- MODULE_AUTHOR("test");
- MODULE_DESCRIPTION("Test");
- MODULE_LICENSE("GPL");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement