summaryrefslogtreecommitdiff
path: root/ANDROID_3.4.5/drivers/input/sensor/sensor.c
diff options
context:
space:
mode:
authorSrikant Patnaik2015-01-11 12:28:04 +0530
committerSrikant Patnaik2015-01-11 12:28:04 +0530
commit871480933a1c28f8a9fed4c4d34d06c439a7a422 (patch)
tree8718f573808810c2a1e8cb8fb6ac469093ca2784 /ANDROID_3.4.5/drivers/input/sensor/sensor.c
parent9d40ac5867b9aefe0722bc1f110b965ff294d30d (diff)
downloadFOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.gz
FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.bz2
FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.zip
Moved, renamed, and deleted files
The original directory structure was scattered and unorganized. Changes are basically to make it look like kernel structure.
Diffstat (limited to 'ANDROID_3.4.5/drivers/input/sensor/sensor.c')
-rwxr-xr-xANDROID_3.4.5/drivers/input/sensor/sensor.c114
1 files changed, 0 insertions, 114 deletions
diff --git a/ANDROID_3.4.5/drivers/input/sensor/sensor.c b/ANDROID_3.4.5/drivers/input/sensor/sensor.c
deleted file mode 100755
index 5a82a9fb..00000000
--- a/ANDROID_3.4.5/drivers/input/sensor/sensor.c
+++ /dev/null
@@ -1,114 +0,0 @@
-#include <linux/i2c.h>
-#include <linux/export.h>
-//#include <linux/mutex.h>
-#include "sensor.h"
-//DEFINE_MUTEX(mutex_client);
-//static struct i2c_client *sensor_client=NULL;
-struct i2c_client *sensor_i2c_register_device(int bus_no, int client_addr, const char *client_name)
-{
- struct i2c_adapter *adapter = NULL;
- struct i2c_client *sensor_client=NULL;
-
- struct i2c_board_info sensor_i2c_board_info = {
- .type = "unused",
- .flags = 0x00,
- .addr = 0xff,
- .platform_data = NULL,
- .archdata = NULL,
- .irq = -1,
- };
-
- if ((bus_no<0) || (client_addr>0x7f) || (client_addr<0)|| (!client_name))
- {
- printk(KERN_ERR "%s param error! pls check out!\n", __FUNCTION__);
- return NULL;
- }
- printk(KERN_INFO "%s busno %d client_addr 0x%x client_name %s \n", __FUNCTION__, \
- bus_no, client_addr, client_name);
-
- sensor_i2c_board_info.addr = client_addr;
- //sensor_i2c_board_info.type = client_name;
- strcpy(sensor_i2c_board_info.type, client_name);
-
- adapter = i2c_get_adapter(bus_no);/*in bus NR*/
-
- if (NULL == adapter) {
- printk("can not get i2c adapter, client address error\n");
- return NULL;
- }
-
- //mutex_lock(&mutex_client);
- sensor_client = i2c_new_device(adapter, &sensor_i2c_board_info);
-
-
- if (sensor_client == NULL) {
- printk("allocate i2c client failed\n");
- //mutex_unlock(&mutex_client);
- return NULL;
- }
- i2c_put_adapter(adapter);
- //mutex_unlock(&mutex_client);
-
- return sensor_client;
-}
-EXPORT_SYMBOL(sensor_i2c_register_device);
-
-struct i2c_client *sensor_i2c_register_device2(int bus_no, int client_addr, const char *client_name,void *pdata)
-{
- struct i2c_adapter *adapter = NULL;
- struct i2c_client *sensor_client=NULL;
-
- struct i2c_board_info sensor_i2c_board_info = {
- .type = "unused",
- .flags = 0x00,
- .addr = 0xff,
- .platform_data = NULL,
- .archdata = NULL,
- .irq = -1,
- };
-
- if ((bus_no<0) || (client_addr>0x7f) || (client_addr<0)|| (!client_name))
- {
- printk(KERN_ERR "%s param error! pls check out!\n", __FUNCTION__);
- return NULL;
- }
- printk(KERN_INFO "%s busno %d client_addr 0x%x client_name %s \n", __FUNCTION__, \
- bus_no, client_addr, client_name);
-
- sensor_i2c_board_info.addr = client_addr;
- sensor_i2c_board_info.platform_data = pdata;
- //sensor_i2c_board_info.type = client_name;
- strcpy(sensor_i2c_board_info.type, client_name);
-
- adapter = i2c_get_adapter(bus_no);/*in bus NR*/
-
- if (NULL == adapter) {
- printk("can not get i2c adapter, client address error\n");
- return NULL;
- }
-
- //mutex_lock(&mutex_client);
- sensor_client = i2c_new_device(adapter, &sensor_i2c_board_info);
-
-
- if (sensor_client == NULL) {
- printk("allocate i2c client failed\n");
- //mutex_unlock(&mutex_client);
- return NULL;
- }
- i2c_put_adapter(adapter);
- //mutex_unlock(&mutex_client);
-
- return sensor_client;
-}
-EXPORT_SYMBOL(sensor_i2c_register_device2);
-
-void sensor_i2c_unregister_device(struct i2c_client *client)
-{
- if (client != NULL)
- {
- i2c_unregister_device(client);
- }
-}
-EXPORT_SYMBOL(sensor_i2c_unregister_device);
-