aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/battery/max17047_fuelgauge_c.h109
-rw-r--r--include/linux/battery/samsung_battery.h4
-rw-r--r--include/linux/cpu_pm.h109
-rw-r--r--include/linux/device-mapper.h43
-rw-r--r--include/linux/exynos_audio.h14
-rw-r--r--include/linux/gpio_keys.h3
-rw-r--r--include/linux/i2c/touchkey_i2c.h1
-rw-r--r--include/linux/input.h14
-rw-r--r--include/linux/mod_devicetable.h6
-rw-r--r--include/linux/platform_data/lp855x.h132
-rw-r--r--include/linux/power_supply.h5
-rw-r--r--include/linux/sensor/gp2a.h7
-rw-r--r--include/linux/sensor/sensors_core.h3
-rw-r--r--include/linux/sensor/yas.h474
-rw-r--r--include/linux/sensor/yas_cfg.h250
-rw-r--r--include/linux/synaptics_s7301.h100
-rw-r--r--include/linux/sync.h71
-rw-r--r--include/linux/wacom_i2c.h41
-rw-r--r--include/media/sr130pc20_platform.h55
-rw-r--r--include/trace/events/sync.h82
20 files changed, 1497 insertions, 26 deletions
diff --git a/include/linux/battery/max17047_fuelgauge_c.h b/include/linux/battery/max17047_fuelgauge_c.h
new file mode 100644
index 0000000..157314b
--- /dev/null
+++ b/include/linux/battery/max17047_fuelgauge_c.h
@@ -0,0 +1,109 @@
+/*
+ * max17047_fuelgauge.h
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * SangYoung Son <hello.son@samsung.com>
+ *
+ * based on max17042_battery.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * 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 __MAX17047_BATTERY_H_
+#define __MAX17047_BATTERY_H_
+
+//#if defined (CONFIG_FUELGAUGE_MAX17047_COULOMB_COUNTING)
+/* jig state */
+extern bool is_jig_attached;
+
+#define CURRENT_RANGE_MAX_NUM 5
+#define TEMP_RANGE_MAX_NUM 3
+
+enum {
+ SDI = 0,
+};
+
+enum {
+ RANGE = 0,
+ SLOPE,
+ OFFSET,
+ TABLE_MAX
+};
+
+
+struct battery_data_t {
+ u16 Capacity;
+ u16 low_battery_comp_voltage;
+ s32 low_battery_table[CURRENT_RANGE_MAX_NUM][TABLE_MAX];
+ s32 temp_adjust_table[TEMP_RANGE_MAX_NUM][TABLE_MAX];
+ u8 *type_str;
+};
+
+enum {
+ FG_LEVEL = 0,
+ FG_TEMPERATURE,
+ FG_VOLTAGE,
+ FG_CURRENT,
+ FG_CURRENT_AVG,
+ FG_CHECK_STATUS,
+ FG_RAW_SOC,
+ FG_VF_SOC,
+ FG_AV_SOC,
+ FG_FULLCAP,
+ FG_MIXCAP,
+ FG_AVCAP,
+ FG_REPCAP,
+};
+
+enum {
+ POSITIVE = 0,
+ NEGATIVE,
+};
+
+#define LOW_BATT_COMP_RANGE_NUM 5
+#define LOW_BATT_COMP_LEVEL_NUM 2
+#define MAX_LOW_BATT_CHECK_CNT 10
+
+/* FullCap learning setting */
+#define VFFULLCAP_CHECK_INTERVAL 300 /* sec */
+/* soc should be 0.1% unit */
+#define VFSOC_FOR_FULLCAP_LEARNING 950
+#define LOW_CURRENT_FOR_FULLCAP_LEARNING 20
+#define HIGH_CURRENT_FOR_FULLCAP_LEARNING 120
+#define LOW_AVGCURRENT_FOR_FULLCAP_LEARNING 20
+#define HIGH_AVGCURRENT_FOR_FULLCAP_LEARNING 100
+
+/* power off margin */
+/* soc should be 0.1% unit */
+#define POWER_OFF_SOC_HIGH_MARGIN 20
+#define POWER_OFF_VOLTAGE_HIGH_MARGIN 3500
+#define POWER_OFF_VOLTAGE_LOW_MARGIN 3400
+
+/* FG recovery handler */
+/* soc should be 0.1% unit */
+#define STABLE_LOW_BATTERY_DIFF 30
+#define STABLE_LOW_BATTERY_DIFF_LOWBATT 10
+#define LOW_BATTERY_SOC_REDUCE_UNIT 10
+
+
+//#endif
+
+struct max17047_platform_data {
+ int irq_gpio;
+
+ bool enable_current_sense;
+ bool enable_gauging_temperature;
+
+ const char *psy_name;
+};
+
+#endif
+
diff --git a/include/linux/battery/samsung_battery.h b/include/linux/battery/samsung_battery.h
index 2293fce..acaed33 100644
--- a/include/linux/battery/samsung_battery.h
+++ b/include/linux/battery/samsung_battery.h
@@ -185,6 +185,10 @@ struct battery_info {
unsigned int prev_battery_soc;
struct wake_lock update_wake_lock;
#endif
+#if defined(CONFIG_MACH_KONA)
+ unsigned int is_comp_3;
+ unsigned int is_comp_1;
+#endif
};
/* jig state */
diff --git a/include/linux/cpu_pm.h b/include/linux/cpu_pm.h
new file mode 100644
index 0000000..455b233
--- /dev/null
+++ b/include/linux/cpu_pm.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2011 Google, Inc.
+ *
+ * Author:
+ * Colin Cross <ccross@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_CPU_PM_H
+#define _LINUX_CPU_PM_H
+
+#include <linux/kernel.h>
+#include <linux/notifier.h>
+
+/*
+ * When a CPU goes to a low power state that turns off power to the CPU's
+ * power domain, the contents of some blocks (floating point coprocessors,
+ * interrupt controllers, caches, timers) in the same power domain can
+ * be lost. The cpm_pm notifiers provide a method for platform idle, suspend,
+ * and hotplug implementations to notify the drivers for these blocks that
+ * they may be reset.
+ *
+ * All cpu_pm notifications must be called with interrupts disabled.
+ *
+ * The notifications are split into two classes: CPU notifications and CPU
+ * cluster notifications.
+ *
+ * CPU notifications apply to a single CPU and must be called on the affected
+ * CPU. They are used to save per-cpu context for affected blocks.
+ *
+ * CPU cluster notifications apply to all CPUs in a single power domain. They
+ * are used to save any global context for affected blocks, and must be called
+ * after all the CPUs in the power domain have been notified of the low power
+ * state.
+ */
+
+/*
+ * Event codes passed as unsigned long val to notifier calls
+ */
+enum cpu_pm_event {
+ /* A single cpu is entering a low power state */
+ CPU_PM_ENTER,
+
+ /* A single cpu failed to enter a low power state */
+ CPU_PM_ENTER_FAILED,
+
+ /* A single cpu is exiting a low power state */
+ CPU_PM_EXIT,
+
+ /* A cpu power domain is entering a low power state */
+ CPU_CLUSTER_PM_ENTER,
+
+ /* A cpu power domain failed to enter a low power state */
+ CPU_CLUSTER_PM_ENTER_FAILED,
+
+ /* A cpu power domain is exiting a low power state */
+ CPU_CLUSTER_PM_EXIT,
+};
+
+#ifdef CONFIG_CPU_PM
+int cpu_pm_register_notifier(struct notifier_block *nb);
+int cpu_pm_unregister_notifier(struct notifier_block *nb);
+int cpu_pm_enter(void);
+int cpu_pm_exit(void);
+int cpu_cluster_pm_enter(void);
+int cpu_cluster_pm_exit(void);
+
+#else
+
+static inline int cpu_pm_register_notifier(struct notifier_block *nb)
+{
+ return 0;
+}
+
+static inline int cpu_pm_unregister_notifier(struct notifier_block *nb)
+{
+ return 0;
+}
+
+static inline int cpu_pm_enter(void)
+{
+ return 0;
+}
+
+static inline int cpu_pm_exit(void)
+{
+ return 0;
+}
+
+static inline int cpu_cluster_pm_enter(void)
+{
+ return 0;
+}
+
+static inline int cpu_cluster_pm_exit(void)
+{
+ return 0;
+}
+#endif
+#endif
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 4427e04..3fa1f3d 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -208,6 +208,49 @@ struct dm_target_callbacks {
int dm_register_target(struct target_type *t);
void dm_unregister_target(struct target_type *t);
+/*
+ * Target argument parsing.
+ */
+struct dm_arg_set {
+ unsigned argc;
+ char **argv;
+};
+
+/*
+ * The minimum and maximum value of a numeric argument, together with
+ * the error message to use if the number is found to be outside that range.
+ */
+struct dm_arg {
+ unsigned min;
+ unsigned max;
+ char *error;
+};
+
+/*
+ * Validate the next argument, either returning it as *value or, if invalid,
+ * returning -EINVAL and setting *error.
+ */
+int dm_read_arg(struct dm_arg *arg, struct dm_arg_set *arg_set,
+ unsigned *value, char **error);
+
+/*
+ * Process the next argument as the start of a group containing between
+ * arg->min and arg->max further arguments. Either return the size as
+ * *num_args or, if invalid, return -EINVAL and set *error.
+ */
+int dm_read_arg_group(struct dm_arg *arg, struct dm_arg_set *arg_set,
+ unsigned *num_args, char **error);
+
+/*
+ * Return the current argument and shift to the next.
+ */
+const char *dm_shift_arg(struct dm_arg_set *as);
+
+/*
+ * Move through num_args arguments.
+ */
+void dm_consume_args(struct dm_arg_set *as, unsigned num_args);
+
/*-----------------------------------------------------------------
* Functions for creating and manipulating mapped devices.
* Drop the reference with dm_put when you finish with the object.
diff --git a/include/linux/exynos_audio.h b/include/linux/exynos_audio.h
index b510119..c429ffc 100644
--- a/include/linux/exynos_audio.h
+++ b/include/linux/exynos_audio.h
@@ -22,6 +22,15 @@
#ifndef _LINUX_EXYNOS_T0_SOUND_H
#define _LINUX_EXYNOS_T0_SOUND_H
+#ifdef CONFIG_USE_ADC_DET
+struct jack_zone {
+ unsigned int adc_high;
+ unsigned int delay_ms;
+ unsigned int check_count;
+ unsigned int jack_type;
+};
+#endif
+
struct exynos_sound_platform_data {
void (*set_lineout_switch) (int on);
void (*set_ext_main_mic) (int on);
@@ -33,6 +42,11 @@ struct exynos_sound_platform_data {
#endif
int dcs_offset_l;
int dcs_offset_r;
+#ifdef CONFIG_USE_ADC_DET
+ struct jack_zone *zones;
+ int num_zones;
+ int use_jackdet_type;
+#endif
};
#ifdef CONFIG_EXYNOS_SOUND_PLATFORM_DATA
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h
index c3be488..a396a5b 100644
--- a/include/linux/gpio_keys.h
+++ b/include/linux/gpio_keys.h
@@ -24,6 +24,9 @@ struct gpio_keys_platform_data {
int (*enable)(struct device *dev);
void (*disable)(struct device *dev);
const char *name; /* input device name */
+#ifdef CONFIG_SENSORS_HALL
+ int gpio_flip_cover;
+#endif
};
#endif
diff --git a/include/linux/i2c/touchkey_i2c.h b/include/linux/i2c/touchkey_i2c.h
index be989b5..60002d2 100644
--- a/include/linux/i2c/touchkey_i2c.h
+++ b/include/linux/i2c/touchkey_i2c.h
@@ -188,6 +188,7 @@ struct touchkey_i2c {
int (*power)(int on);
struct work_struct update_work;
int update_status;
+ atomic_t keypad_enable;
};
#endif /* _LINUX_CYPRESS_TOUCHKEY_I2C_H */
diff --git a/include/linux/input.h b/include/linux/input.h
index d75f6f5..5694583 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -449,6 +449,11 @@ struct input_keymap_entry {
#define KEY_FOLDER_CLOSE 252 /*only use Grande CHN CTC */
#define KEY_3G 253 /*only use Grande CHN CTC */
+/* kona dummy touchkey */
+#define KEY_DUMMY_1 251
+#define KEY_DUMMY_2 252
+#define KEY_DUMMY_3 253
+
/* Code 255 is reserved for special needs of AT keyboard driver */
#define BTN_MISC 0x100
@@ -836,7 +841,14 @@ struct input_keymap_entry {
#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */
#define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */
#define SW_PEN_INSERT 0x0e /* set = pen out */
-#define SW_MAX 0x0f
+#define SW_STROBE_INSERT 0x0f /* set = strobe out */
+//#ifdef CONFIG_SENSORS_HALL
+//#define SW_FLIP 0x10 /* set = flip cover... */
+//#define SW_MAX 0x17
+//#else
+#define SW_MAX 0x10
+//#endif
+
#define SW_CNT (SW_MAX+1)
/*
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index ae28e93..e21658d 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -292,7 +292,11 @@ struct pcmcia_device_id {
#define INPUT_DEVICE_ID_LED_MAX 0x0f
#define INPUT_DEVICE_ID_SND_MAX 0x07
#define INPUT_DEVICE_ID_FF_MAX 0x7f
-#define INPUT_DEVICE_ID_SW_MAX 0x0f
+/*#ifdef CONFIG_SENSORS_HALL
+#define INPUT_DEVICE_ID_SW_MAX 0x17
+#else*/
+#define INPUT_DEVICE_ID_SW_MAX 0x10
+//#endif
#define INPUT_DEVICE_ID_MATCH_BUS 1
#define INPUT_DEVICE_ID_MATCH_VENDOR 2
diff --git a/include/linux/platform_data/lp855x.h b/include/linux/platform_data/lp855x.h
new file mode 100644
index 0000000..a3398fb
--- /dev/null
+++ b/include/linux/platform_data/lp855x.h
@@ -0,0 +1,132 @@
+/*
+ * LP855x Backlight Driver
+ *
+ * Copyright (C) 2011 Texas Instruments
+ *
+ * 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.
+ *
+ */
+
+#ifndef _LP855X_H
+#define _LP855X_H
+
+#define BL_CTL_SHFT (0)
+#define BRT_MODE_SHFT (1)
+#define BRT_MODE_MASK (0x06)
+
+/* Enable backlight. Only valid when BRT_MODE=10(I2C only) */
+#define ENABLE_BL (1)
+#define DISABLE_BL (0)
+
+#define I2C_CONFIG(id) id ## _I2C_CONFIG
+#define PWM_CONFIG(id) id ## _PWM_CONFIG
+
+/* DEVICE CONTROL register - LP8550 */
+#define LP8550_PWM_CONFIG (LP8550_PWM_ONLY << BRT_MODE_SHFT)
+#define LP8550_I2C_CONFIG ((ENABLE_BL << BL_CTL_SHFT) | \
+ (LP8550_I2C_ONLY << BRT_MODE_SHFT))
+
+/* DEVICE CONTROL register - LP8551 */
+#define LP8551_PWM_CONFIG LP8550_PWM_CONFIG
+#define LP8551_I2C_CONFIG LP8550_I2C_CONFIG
+
+/* DEVICE CONTROL register - LP8552 */
+#define LP8552_PWM_CONFIG LP8550_PWM_CONFIG
+#define LP8552_I2C_CONFIG LP8550_I2C_CONFIG
+
+/* DEVICE CONTROL register - LP8553 */
+#define LP8553_PWM_CONFIG LP8550_PWM_CONFIG
+#define LP8553_I2C_CONFIG LP8550_I2C_CONFIG
+
+/* DEVICE CONTROL register - LP8556 */
+#define LP8556_PWM_CONFIG (LP8556_PWM_ONLY << BRT_MODE_SHFT)
+#define LP8556_COMB1_CONFIG (LP8556_COMBINED1 << BRT_MODE_SHFT)
+#define LP8556_I2C_CONFIG ((ENABLE_BL << BL_CTL_SHFT) | \
+ (LP8556_I2C_ONLY << BRT_MODE_SHFT))
+#define LP8556_COMB2_CONFIG (LP8556_COMBINED2 << BRT_MODE_SHFT)
+
+enum lp855x_chip_id {
+ LP8550,
+ LP8551,
+ LP8552,
+ LP8553,
+ LP8556,
+};
+
+enum lp855x_brightness_ctrl_mode {
+ PWM_BASED = 1,
+ REGISTER_BASED,
+};
+
+enum lp8550_brighntess_source {
+ LP8550_PWM_ONLY,
+ LP8550_I2C_ONLY = 2,
+};
+
+enum lp8551_brighntess_source {
+ LP8551_PWM_ONLY = LP8550_PWM_ONLY,
+ LP8551_I2C_ONLY = LP8550_I2C_ONLY,
+};
+
+enum lp8552_brighntess_source {
+ LP8552_PWM_ONLY = LP8550_PWM_ONLY,
+ LP8552_I2C_ONLY = LP8550_I2C_ONLY,
+};
+
+enum lp8553_brighntess_source {
+ LP8553_PWM_ONLY = LP8550_PWM_ONLY,
+ LP8553_I2C_ONLY = LP8550_I2C_ONLY,
+};
+
+enum lp8556_brightness_source {
+ LP8556_PWM_ONLY,
+ LP8556_COMBINED1, /* pwm + i2c before the shaper block */
+ LP8556_I2C_ONLY,
+ LP8556_COMBINED2, /* pwm + i2c after the shaper block */
+};
+
+struct lp855x_pwm_data {
+ void (*pwm_set_intensity) (int brightness, int max_brightness);
+ int (*pwm_get_intensity) (int max_brightness);
+};
+
+struct lp855x_rom_data {
+ u8 addr;
+ u8 val;
+ u8 mask;
+};
+
+/**
+ * struct lp855x_platform_data
+ * @name : Backlight driver name. If it is not defined, default name is set.
+ * @mode : brightness control by pwm or lp855x register
+ * @device_control : value of DEVICE CONTROL register
+ * @initial_brightness : initial value of backlight brightness
+ * @pwm_data : platform specific pwm generation functions.
+ Only valid when mode is PWM_BASED.
+ * @load_new_rom_data :
+ 0 : use default configuration data
+ 1 : update values of eeprom or eprom registers on loading driver
+ * @size_program : total size of lp855x_rom_data
+ * @rom_data : list of new eeprom/eprom registers
+ * @use_gpio_en : 1: use driver control power_en
+ * @gpio_en : power on gpio.
+ * @power_on_udelay : stable time needing to becom led power on.
+ */
+struct lp855x_platform_data {
+ char *name;
+ enum lp855x_brightness_ctrl_mode mode;
+ u8 device_control;
+ int initial_brightness;
+ struct lp855x_pwm_data pwm_data;
+ u8 load_new_rom_data;
+ int size_program;
+ struct lp855x_rom_data *rom_data;
+ u8 use_gpio_en;
+ unsigned gpio_en;
+ unsigned long power_on_udelay;
+};
+
+#endif
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 529d981..8289fca 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -126,6 +126,11 @@ enum power_supply_property {
POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER,
POWER_SUPPLY_PROP_SERIAL_NUMBER,
+#if defined(CONFIG_MACH_KONA)
+ POWER_SUPPLY_PROP_CHARGING_MODE,
+ POWER_SUPPLY_PROP_COMPENSATION_1,
+ POWER_SUPPLY_PROP_COMPENSATION_3,
+#endif
};
enum power_supply_type {
diff --git a/include/linux/sensor/gp2a.h b/include/linux/sensor/gp2a.h
index 4b2b62c..20b2014 100644
--- a/include/linux/sensor/gp2a.h
+++ b/include/linux/sensor/gp2a.h
@@ -28,6 +28,11 @@
#define ADC_BUFFER_NUM 6
+#define DEFAULT_LO_THR 0x07 /* sharp recommand Loff */
+#define DEFAULT_HI_THR 0x08 /* sharp recommand Lon */
+
+#define OFFSET_ARRAY_LENGTH 10
+
/* 16 level for premium model*/
enum {
LIGHT_DIM = 0,
@@ -64,6 +69,6 @@ int is_gp2a030a(void);
struct gp2a_platform_data {
int (*gp2a_led_on) (bool);
int p_out; /* proximity-sensor-output gpio */
- unsigned long (*gp2a_get_threshold)(void);
+ unsigned long (*gp2a_get_threshold)(u8 *);
};
#endif
diff --git a/include/linux/sensor/sensors_core.h b/include/linux/sensor/sensors_core.h
index 969e460..03e86c0 100644
--- a/include/linux/sensor/sensors_core.h
+++ b/include/linux/sensor/sensors_core.h
@@ -13,6 +13,9 @@
extern struct device *sensors_classdev_register(char *sensors_name);
extern void sensors_classdev_unregister(struct device *dev);
+extern int sensors_register(struct device *dev,
+ void *drvdata, struct device_attribute *attributes[], char *name);
+extern void sensors_unregister(struct device *dev);
struct accel_platform_data {
int (*accel_get_position) (void);
diff --git a/include/linux/sensor/yas.h b/include/linux/sensor/yas.h
new file mode 100644
index 0000000..4f89d0a
--- /dev/null
+++ b/include/linux/sensor/yas.h
@@ -0,0 +1,474 @@
+/*
+ * Copyright (c) 2010-2011 Yamaha Corporation
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#ifndef __YAS_H__
+#define __YAS_H__
+
+#include "yas_cfg.h"
+
+#define YAS_VERSION "9.0.8"
+
+/* ------------------ */
+/* Typedef definition */
+/* ------------------- */
+
+#include <linux/types.h>
+
+
+/* -------------------------- */
+/* Macro definition */
+/* ------------------------- */
+
+/* Debugging */
+#define DEBUG (0)
+
+#if DEBUG
+#include <linux/kernel.h>
+#define YLOGD(args) (printk args)
+#define YLOGI(args) (printk args)
+#define YLOGE(args) (printk args)
+#define YLOGW(args) (printk args)
+#else /* DEBUG */
+#define YLOGD(args)
+#define YLOGI(args)
+#define YLOGW(args)
+#define YLOGE(args)
+#endif /* DEBUG */
+
+#define YAS_REPORT_DATA (0x01)
+#define YAS_REPORT_CALIB (0x02)
+#define YAS_REPORT_OVERFLOW_OCCURED (0x04)
+#define YAS_REPORT_HARD_OFFSET_CHANGED (0x08)
+#define YAS_REPORT_CALIB_OFFSET_CHANGED (0x10)
+#define YAS_X_OVERFLOW (0x01)
+#define YAS_X_UNDERFLOW (0x02)
+#define YAS_Y1_OVERFLOW (0x04)
+#define YAS_Y1_UNDERFLOW (0x08)
+#define YAS_Y2_OVERFLOW (0x10)
+#define YAS_Y2_UNDERFLOW (0x20)
+
+#define YAS_HARD_OFFSET_UNKNOWN (0x7f)
+#define YAS_CALIB_OFFSET_UNKNOWN (0x7fffffff)
+
+#define YAS_NO_ERROR (0)
+#define YAS_ERROR_ARG (-1)
+#define YAS_ERROR_NOT_INITIALIZED (-2)
+#define YAS_ERROR_BUSY (-3)
+#define YAS_ERROR_DEVICE_COMMUNICATION (-4)
+#define YAS_ERROR_CHIP_ID (-5)
+#define YAS_ERROR_NOT_ACTIVE (-6)
+#define YAS_ERROR_RESTARTSYS (-7)
+#define YAS_ERROR_HARDOFFSET_NOT_WRITTEN (-8)
+#define YAS_ERROR_INTERRUPT (-9)
+#define YAS_ERROR_CALREG (-10)
+#define YAS_ERROR_ERROR (-128)
+
+enum cable_type_t {
+ CABLE_TYPE_NONE = 0,
+ CABLE_TYPE_USB,
+ CABLE_TYPE_AC,
+};
+
+#ifndef NULL
+#define NULL ((void *)(0))
+#endif
+#ifndef FALSE
+#define FALSE (0)
+#endif
+#ifndef TRUE
+#define TRUE (!(0))
+#endif
+#ifndef NELEMS
+#define NELEMS(a) ((int)(sizeof(a)/sizeof(a[0])))
+#endif
+#ifndef ABS
+#define ABS(a) ((a) > 0 ? (a) : -(a))
+#endif
+#ifndef M_PI
+#define M_PI (3.14159265358979323846)
+#endif
+#ifndef __GNUC__
+#define __attribute__(x) /* NOTHING */
+#endif
+
+enum {
+ YAS532_POSITION_0 = 1,
+ YAS532_POSITION_1,
+ YAS532_POSITION_2,
+ YAS532_POSITION_3,
+ YAS532_POSITION_4,
+ YAS532_POSITION_5,
+ YAS532_POSITION_6,
+ YAS532_POSITION_7,
+};
+
+#define YAS532_POSITION_OFFSET 1
+
+/* -------------------------------------------------------------------------- */
+/* Structure definition */
+/* -------------------------------------------------------------------------- */
+
+struct acc_platform_data {
+ const char *cal_path;
+ void (*ldo_on) (bool);
+ int orientation;
+};
+struct accel_cal {
+ s16 v[3];
+};
+struct yas_mag_filter {
+ int len;
+ int noise[3];
+ int threshold; /* nT */
+};
+struct yas_vector {
+ int32_t v[3];
+};
+
+struct mag_platform_data {
+ void (*power_on) (bool);
+ int offset_enable;
+ int chg_status;
+ struct yas_vector ta_offset;
+ struct yas_vector usb_offset;
+ struct yas_vector full_offset;
+ int orientation;
+};
+
+struct yas_matrix {
+ int32_t matrix[9];
+};
+struct yas_acc_data {
+ struct yas_vector xyz;
+ struct yas_vector raw;
+};
+struct yas_gyro_data {
+ struct yas_vector xyz;
+ struct yas_vector raw;
+ int overrun;
+ int num;
+};
+struct yas_mag_data {
+ struct yas_vector xyz; /* without offset, filtered */
+ struct yas_vector raw; /* with offset, not filtered */
+ struct yas_vector xy1y2;
+ int16_t temperature;
+};
+
+struct yas_mag_offset {
+ int8_t hard_offset[3];
+ struct yas_vector calib_offset;
+};
+struct yas_mag_status {
+ struct yas_mag_offset offset;
+ int accuracy;
+ struct yas_matrix dynamic_matrix;
+};
+struct yas_offset {
+ struct yas_mag_status mag[YAS_MAGCALIB_SHAPE_NUM];
+};
+
+struct yas_mag_driver_callback {
+ int (*lock) (void);
+ int (*unlock) (void);
+ int (*device_open) (void);
+ int (*device_close) (void);
+#if YAS_MAG_DRIVER == YAS_MAG_DRIVER_YAS529
+ int (*device_write) (const uint8_t *buf, int len);
+ int (*device_read) (uint8_t *buf, int len);
+#else
+ int (*device_write) (uint8_t addr, const uint8_t *buf, int len);
+ int (*device_read) (uint8_t addr, uint8_t *buf, int len);
+#endif
+ void (*msleep) (int msec);
+ void (*current_time) (int32_t *sec, int32_t *msec);
+};
+
+struct yas_mag_driver {
+ int (*init) (void);
+ int (*term) (void);
+ int (*get_delay) (void);
+ int (*set_delay) (int msec);
+ int (*get_offset) (struct yas_mag_offset *offset);
+ int (*set_offset) (struct yas_mag_offset *offset);
+#ifdef YAS_MAG_MANUAL_OFFSET
+ int (*get_manual_offset) (struct yas_vector *offset);
+ int (*set_manual_offset) (struct yas_vector *offset);
+#endif
+ int (*get_static_matrix) (struct yas_matrix *static_matrix);
+ int (*set_static_matrix) (struct yas_matrix *static_matrix);
+ int (*get_dynamic_matrix) (struct yas_matrix *dynamic_matrix);
+ int (*set_dynamic_matrix) (struct yas_matrix *dynamic_matrix);
+ int (*get_enable) (void);
+ int (*set_enable) (int enable);
+ int (*get_filter) (struct yas_mag_filter *filter);
+ int (*set_filter) (struct yas_mag_filter *filter);
+ int (*get_filter_enable) (void);
+ int (*set_filter_enable) (int enable);
+ int (*get_position) (void);
+ int (*set_position) (int position);
+#if YAS_MAG_DRIVER == YAS_MAG_DRIVER_YAS529
+ int (*read_reg) (uint8_t *buf, int len);
+ int (*write_reg) (const uint8_t *buf, int len);
+#else
+ int (*read_reg) (uint8_t addr, uint8_t *buf, int len);
+ int (*write_reg) (uint8_t addr, const uint8_t *buf, int len);
+#endif
+ int (*measure) (struct yas_mag_data *data, int *time_delay_ms);
+ struct yas_mag_driver_callback callback;
+};
+
+struct yas_mag_calibration_result {
+ int32_t spread;
+ int32_t variation;
+ int32_t radius;
+ int8_t axis;
+ int8_t level;
+ int8_t accuracy;
+ struct yas_matrix dynamic_matrix;
+};
+
+struct yas_mag_calibration_threshold {
+ int32_t spread;
+ int32_t variation[3];
+};
+
+struct yas_mag_calibration_callback {
+ int (*lock) (void);
+ int (*unlock) (void);
+};
+
+#define YAS_MAGCALIB_MODE_SPHERE (0)
+#define YAS_MAGCALIB_MODE_ELLIPSOID (1)
+
+struct yas_mag_calibration {
+ int (*init) (void);
+ int (*term) (void);
+ int (*update) (struct yas_vector *mag,
+ struct yas_mag_calibration_result *result);
+ int (*get_accuracy) (void);
+ int (*set_accuracy) (int accuracy);
+ int (*get_offset) (struct yas_vector *offset);
+ int (*set_offset) (struct yas_vector *offset);
+ int (*get_shape) (void);
+ int (*set_shape) (int shape);
+ int (*get_threshold) (struct yas_mag_calibration_threshold *threshold);
+ int (*set_threshold) (struct yas_mag_calibration_threshold *threshold);
+ int (*get_mode) (void);
+ int (*set_mode) (int mode);
+ int (*get_max_sample) (void);
+ int (*set_max_sample) (int num_samples);
+ int (*get_dynamic_matrix) (struct yas_matrix *dynamic_matrix);
+ struct yas_mag_calibration_callback callback;
+};
+
+#if YAS_SUPPORT_FUSION_DRIVER
+
+struct yas_quaternion {
+ int32_t q[4];
+};
+
+struct yas_fusion_callback {
+ int (*lock) (void);
+ int (*unlock) (void);
+ void (*current_time) (int32_t *sec, int32_t *msec);
+};
+
+struct yas_fusion {
+ int (*init) (void);
+ int (*term) (void);
+ int (*update) (struct yas_vector *acc, struct yas_vector *mag,
+ struct yas_vector *gyro);
+ int (*get_quaternion) (struct yas_quaternion *quaternion);
+ int (*get_fusion) (struct yas_quaternion *quaternion,
+ struct yas_vector *acc, struct yas_vector *gravity,
+ struct yas_vector *linear_acceleration,
+ struct yas_vector *rotation_vector);
+ struct yas_fusion_callback callback;
+};
+#endif
+
+#if YAS_SUPPORT_SOFTWARE_GYROSCOPE
+
+struct yas_swgyro_callback {
+ int (*lock) (void);
+ int (*unlock) (void);
+};
+
+struct yas_swgyro {
+ int (*init) (void);
+ int (*term) (void);
+ int (*get_delay) (void);
+ int (*set_delay) (int msec);
+ int (*update) (struct yas_vector *acc, struct yas_vector *mag,
+ struct yas_vector *gyro);
+ struct yas_swgyro_callback callback;
+};
+
+#endif
+
+struct yas_acc_filter {
+ int threshold; /* um/s^2 */
+};
+
+struct yas_acc_driver_callback {
+ int (*lock) (void);
+ int (*unlock) (void);
+ int (*device_open) (void);
+ int (*device_close) (void);
+ int (*device_write) (uint8_t adr, const uint8_t *buf, int len);
+ int (*device_read) (uint8_t adr, uint8_t *buf, int len);
+ void (*msleep) (int msec);
+};
+
+struct yas_acc_driver {
+ int (*init) (void);
+ int (*term) (void);
+ int (*get_delay) (void);
+ int (*set_delay) (int delay);
+ int (*get_offset) (struct yas_vector *offset);
+ int (*set_offset) (struct yas_vector *offset);
+ int (*get_enable) (void);
+ int (*set_enable) (int enable);
+ int (*get_filter) (struct yas_acc_filter *filter);
+ int (*set_filter) (struct yas_acc_filter *filter);
+ int (*get_filter_enable) (void);
+ int (*set_filter_enable) (int enable);
+ int (*get_position) (void);
+ int (*set_position) (int position);
+ int (*measure) (struct yas_acc_data *data);
+ void (*set_motion_interrupt)(bool enable, bool factorytest);
+ int (*get_motion_interrupt)(void);
+#if DEBUG
+ int (*get_register) (uint8_t adr, uint8_t *val);
+#endif
+ struct yas_acc_driver_callback callback;
+};
+
+struct yas_acc_calibration_threshold {
+ int32_t variation;
+};
+
+struct yas_acc_calibration_callback {
+ int (*lock) (void);
+ int (*unlock) (void);
+};
+
+struct yas_acc_calibration {
+ int (*init) (void);
+ int (*term) (void);
+ int (*update) (struct yas_vector *acc);
+ int (*get_offset) (struct yas_vector *offset);
+ int (*get_threshold) (struct yas_acc_calibration_threshold *threshold);
+ int (*set_threshold) (struct yas_acc_calibration_threshold *threshold);
+ struct yas_acc_calibration_callback callback;
+};
+
+struct yas_gyro_filter {
+ int threshold; /*mdegree/s */
+};
+
+struct yas_gyro_driver_callback {
+ int (*lock) (void);
+ int (*unlock) (void);
+ int (*device_open) (void);
+ int (*device_close) (void);
+ int (*device_write) (uint8_t adr, const uint8_t *buf, int len);
+ int (*device_read) (uint8_t adr, uint8_t *buf, int len);
+ int (*interrupt_enable) (void);
+ int (*interrupt_disable) (void);
+ void (*interrupt_notify) (int num);
+ void (*msleep) (int msec);
+};
+
+struct yas_gyro_driver {
+ int (*init) (void);
+ int (*term) (void);
+ int (*get_delay) (void);
+ int (*set_delay) (int delay);
+ int (*get_offset) (struct yas_vector *offset);
+ int (*set_offset) (struct yas_vector *offset);
+ int (*get_enable) (void);
+ int (*set_enable) (int enable);
+ int (*get_filter) (struct yas_gyro_filter *filter);
+ int (*set_filter) (struct yas_gyro_filter *filter);
+ int (*get_filter_enable) (void);
+ int (*set_filter_enable) (int enable);
+ int (*get_position) (void);
+ int (*set_position) (int position);
+ int (*get_interrupt) (void);
+ int (*set_interrupt) (int interrupt);
+ int (*measure) (struct yas_gyro_data *data, int num);
+ void (*interrupt_handler) (void);
+#if DEBUG
+ int (*get_register) (uint8_t adr, uint8_t *val);
+ int (*set_register) (uint8_t adr, uint8_t val);
+#endif
+ struct yas_gyro_driver_callback callback;
+};
+
+struct yas_gyro_calibration_threshold {
+ int32_t variation;
+};
+
+struct yas_gyro_calibration_callback {
+ int (*lock) (void);
+ int (*unlock) (void);
+};
+
+struct yas_gyro_calibration {
+ int (*init) (void);
+ int (*term) (void);
+ int (*update) (struct yas_vector *gyro);
+ int (*get_offset) (struct yas_vector *offset);
+ int (*get_threshold) (struct yas_gyro_calibration_threshold *
+ threshold);
+ int (*set_threshold) (struct yas_gyro_calibration_threshold *
+ threshold);
+ struct yas_gyro_calibration_callback callback;
+};
+
+struct yas_utility {
+ int (*get_rotation_matrix) (struct yas_vector *acc,
+ struct yas_vector *mag,
+ struct yas_matrix *rotation_matrix);
+ int (*get_euler) (struct yas_matrix *rotation_matrix,
+ struct yas_vector *euler);
+};
+
+/*-------------------------------------------------------------------------- */
+/* Global function definition */
+/*-------------------------------------------------------------------------- */
+
+int yas_mag_driver_init(struct yas_mag_driver *f);
+int yas_mag_calibration_init(struct yas_mag_calibration *f);
+int yas_acc_driver_init(struct yas_acc_driver *f);
+int yas_acc_calibration_init(struct yas_acc_calibration *f);
+int yas_gyro_driver_init(struct yas_gyro_driver *f, int interrupt);
+int yas_gyro_calibration_init(struct yas_gyro_calibration *f);
+int yas_utility_init(struct yas_utility *f);
+#if YAS_SUPPORT_FUSION_DRIVER
+int yas_fusion_init(struct yas_fusion *f);
+#endif
+#if YAS_SUPPORT_SOFTWARE_GYROSCOPE
+int yas_swgyro_init(struct yas_swgyro *f);
+#endif
+
+#endif /*__YAS_H__ */
diff --git a/include/linux/sensor/yas_cfg.h b/include/linux/sensor/yas_cfg.h
new file mode 100644
index 0000000..9af4f47
--- /dev/null
+++ b/include/linux/sensor/yas_cfg.h
@@ -0,0 +1,250 @@
+/*
+ * Copyright (c) 2010-2012 Yamaha Corporation
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#ifndef __YAS_CFG_H__
+#define __YAS_CFG_H__
+
+#define YAS_MAG_DRIVER_NONE (-1)
+#define YAS_MAG_DRIVER_YAS529 (1)
+#define YAS_MAG_DRIVER_YAS530 (2)
+#define YAS_MAG_DRIVER_YAS532 (3)
+
+#define YAS_ACC_DRIVER_NONE (-1)
+#define YAS_ACC_DRIVER_ADXL345 (0)
+#define YAS_ACC_DRIVER_ADXL346 (1)
+#define YAS_ACC_DRIVER_BMA150 (2)
+#define YAS_ACC_DRIVER_BMA222 (3)
+#define YAS_ACC_DRIVER_BMA250 (4)
+#define YAS_ACC_DRIVER_BMA254 (5)
+#define YAS_ACC_DRIVER_KXSD9 (6)
+#define YAS_ACC_DRIVER_KXTE9 (7)
+#define YAS_ACC_DRIVER_KXTF9 (8)
+#define YAS_ACC_DRIVER_KXTJ2 (9)
+#define YAS_ACC_DRIVER_KXUD9 (10)
+#define YAS_ACC_DRIVER_LIS331DL (11)
+#define YAS_ACC_DRIVER_LIS331DLH (12)
+#define YAS_ACC_DRIVER_LIS331DLM (13)
+#define YAS_ACC_DRIVER_LIS3DH (14)
+#define YAS_ACC_DRIVER_MMA8452Q (15)
+#define YAS_ACC_DRIVER_MMA8453Q (16)
+
+#define YAS_GYRO_DRIVER_NONE (-1)
+#define YAS_GYRO_DRIVER_ITG3200 (0)
+#define YAS_GYRO_DRIVER_L3G4200D (1)
+#define YAS_GYRO_DRIVER_EWTZMU (2)
+
+/*----------------------------------------------------------------------------*/
+/* Configuration */
+/*----------------------------------------------------------------------------*/
+
+
+#ifdef CONFIG_ACC_DRIVER_LIS3DH
+#define YAS_ACC_DRIVER (YAS_ACC_DRIVER_LIS3DH)
+#else
+#define YAS_ACC_DRIVER (YAS_ACC_DRIVER_BMA250)
+#endif
+
+#ifdef CONFIG_MAG_DRIVER_YAS532
+#define YAS_MAG_DRIVER (YAS_MAG_DRIVER_YAS532)
+#else
+#define YAS_MAG_DRIVER (YAS_MAG_DRIVER_YAS530)
+#endif
+#define YAS_GYRO_DRIVER (YAS_GYRO_DRIVER_NONE)
+
+/*----------------------------------------------------------------------------*/
+/* Acceleration Calibration Configuration */
+/*----------------------------------------------------------------------------*/
+
+
+#define YAS_DEFAULT_ACCCALIB_LENGTH (20)
+
+#if YAS_ACC_DRIVER == YAS_ACC_DRIVER_ADXL345
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (8000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_ADXL346
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (4000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_BMA150
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (4000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_BMA222
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (25000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_BMA250
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (20000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_BMA254
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (4000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_KXSD9
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (80000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_KXTE9
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (400000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_KXTF9
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (2000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_KXTJ2
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (8000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_KXUD9
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (20000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_LIS331DL
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (17000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_LIS331DLH
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (6000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_LIS331DLM
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (28000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_LIS3DH
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (18000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_MMA8452Q
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (1000)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_MMA8453Q
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (1000)
+#else
+#define YAS_DEFAULT_ACCCALIB_DISTORTION (0)
+#endif
+
+/*----------------------------------------------------------------------------*/
+/* Accelerometer Filter Configuration */
+/*----------------------------------------------------------------------------*/
+
+#if YAS_ACC_DRIVER == YAS_ACC_DRIVER_ADXL345
+#define YAS_ACC_DEFAULT_FILTER_THRESH (76612)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_ADXL346
+#define YAS_ACC_DEFAULT_FILTER_THRESH (76612)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_BMA150
+#define YAS_ACC_DEFAULT_FILTER_THRESH (76612)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_BMA222
+#define YAS_ACC_DEFAULT_FILTER_THRESH (153227)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_BMA250
+#define YAS_ACC_DEFAULT_FILTER_THRESH (76612)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_BMA254
+#define YAS_ACC_DEFAULT_FILTER_THRESH (19152)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_KXSD9
+#define YAS_ACC_DEFAULT_FILTER_THRESH (239460)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_KXTE9
+#define YAS_ACC_DEFAULT_FILTER_THRESH (612909)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_KXTF9
+#define YAS_ACC_DEFAULT_FILTER_THRESH (19152)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_KXTJ2
+#define YAS_ACC_DEFAULT_FILTER_THRESH (38304)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_KXUD9
+#define YAS_ACC_DEFAULT_FILTER_THRESH (215514)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_LIS331DL
+#define YAS_ACC_DEFAULT_FILTER_THRESH (176518)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_LIS331DLH
+#define YAS_ACC_DEFAULT_FILTER_THRESH (95760)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_LIS331DLM
+#define YAS_ACC_DEFAULT_FILTER_THRESH (306454)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_LIS3DH
+#define YAS_ACC_DEFAULT_FILTER_THRESH (76608)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_MMA8452Q
+#define YAS_ACC_DEFAULT_FILTER_THRESH (19152)
+#elif YAS_ACC_DRIVER == YAS_ACC_DRIVER_MMA8453Q
+#define YAS_ACC_DEFAULT_FILTER_THRESH (38306)
+#else
+#define YAS_ACC_DEFAULT_FILTER_THRESH (0)
+#endif
+
+/*----------------------------------------------------------------------------*/
+/* Geomagnetic Calibration Configuration */
+/*----------------------------------------------------------------------------*/
+
+#define YAS_DEFAULT_MAGCALIB_THRESHOLD (1)
+#define YAS_DEFAULT_MAGCALIB_DISTORTION (15)
+#define YAS_DEFAULT_MAGCALIB_SHAPE (0)
+#define YAS_MAGCALIB_SHAPE_NUM (2)
+#define YAS_MAG_MANUAL_OFFSET
+
+/*----------------------------------------------------------------------------*/
+/* Geomagnetic Filter Configuration */
+/*----------------------------------------------------------------------------*/
+
+#define YAS_MAG_MAX_FILTER_LEN (30)
+#define YAS_MAG_DEFAULT_FILTER_NOISE_X (144) /* sd: 1200 nT */
+#define YAS_MAG_DEFAULT_FILTER_NOISE_Y (144) /* sd: 1200 nT */
+#define YAS_MAG_DEFAULT_FILTER_NOISE_Z (144) /* sd: 1200 nT */
+#define YAS_MAG_DEFAULT_FILTER_LEN (20)
+
+#if YAS_MAG_DRIVER == YAS_MAG_DRIVER_YAS529
+#define YAS_MAG_DEFAULT_FILTER_THRESH (300)
+#elif YAS_MAG_DRIVER == YAS_MAG_DRIVER_YAS530
+#define YAS_MAG_DEFAULT_FILTER_THRESH (100)
+#elif YAS_MAG_DRIVER == YAS_MAG_DRIVER_YAS532
+#define YAS_MAG_DEFAULT_FILTER_THRESH (300)
+#else
+#define YAS_MAG_DEFAULT_FILTER_THRESH (0)
+#endif
+
+/*----------------------------------------------------------------------------*/
+/* Gyroscope Calibration Configuration */
+/*----------------------------------------------------------------------------*/
+
+#define YAS_DEFAULT_GYROCALIB_LENGTH (20)
+
+#if YAS_GYRO_DRIVER == YAS_GYRO_DRIVER_ITG3200
+#define YAS_DEFAULT_GYROCALIB_DISTORTION (0)
+#elif YAS_GYRO_DRIVER == YAS_GYRO_DRIVER_L3G4200D
+#define YAS_DEFAULT_GYROCALIB_DISTORTION (2500000)
+#elif YAS_GYRO_DRIVER == YAS_GYRO_DRIVER_EWTZMU
+#define YAS_DEFAULT_GYROCALIB_DISTORTION (400000)
+#else
+#define YAS_DEFAULT_GYROCALIB_DISTORTION (0)
+#endif
+
+/*----------------------------------------------------------------------------*/
+/* Gyroscope Filter Configuration */
+/*----------------------------------------------------------------------------*/
+#if YAS_GYRO_DRIVER == YAS_GYRO_DRIVER_ITG3200
+#define YAS_GYRO_DEFAULT_FILTER_THRESH (0)
+#elif YAS_GYRO_DRIVER == YAS_GYRO_DRIVER_L3G4200D
+#define YAS_GYRO_DEFAULT_FILTER_THRESH (280) /* 70mdps x 4 */
+#elif YAS_GYRO_DRIVER == YAS_GYRO_DRIVER_EWTZMU
+#define YAS_GYRO_DEFAULT_FILTER_THRESH (320) /* 80mdps x 4 */
+#else
+#define YAS_GYRO_DEFAULT_FILTER_THRESH (0)
+#endif
+
+/*----------------------------------------------------------------------------*/
+/* Gyroscope Configuration */
+/*----------------------------------------------------------------------------*/
+
+#if YAS_GYRO_DRIVER == YAS_GYRO_DRIVER_ITG3200
+#define YAS_GYRO_FIFO_MAX (1)
+#elif YAS_GYRO_DRIVER == YAS_GYRO_DRIVER_L3G4200D
+#define YAS_GYRO_FIFO_MAX (32)
+#elif YAS_GYRO_DRIVER == YAS_GYRO_DRIVER_EWTZMU
+#define YAS_GYRO_FIFO_MAX (32)
+#else
+#define YAS_GYRO_FIFO_MAX (1)
+#endif
+
+/*----------------------------------------------------------------------------*/
+/* Other Configuration */
+/*----------------------------------------------------------------------------*/
+#undef YAS_SENSOR_KERNEL_DEVFILE_INTERFACE
+#define YAS_SUPPORT_FUSION_DRIVER (0)
+#define YAS_SUPPORT_SOFTWARE_GYROSCOPE (0)
+
+#if YAS_ACC_DRIVER == YAS_ACC_DRIVER_NONE \
+ || YAS_MAG_DRIVER == YAS_MAG_DRIVER_NONE \
+ || YAS_GYRO_DRIVER == YAS_GYRO_DRIVER_NONE
+#undef YAS_SUPPORT_FUSION_DRIVER
+#define YAS_SUPPORT_FUSION_DRIVER (0)
+#endif
+
+#if YAS_SUPPORT_SOFTWARE_GYROSCOPE && YAS_GYRO_DRIVER != YAS_GYRO_DRIVER_NONE
+#undef YAS_SUPPORT_SOFTWARE_GYROSCOPE
+#define YAS_SUPPORT_SOFTWARE_GYROSCOPE (0)
+#endif
+
+#endif
diff --git a/include/linux/synaptics_s7301.h b/include/linux/synaptics_s7301.h
index 09284a0..13b4c5c 100644
--- a/include/linux/synaptics_s7301.h
+++ b/include/linux/synaptics_s7301.h
@@ -50,10 +50,57 @@
#define FUNC_ADDR_SIZE 6
#define FUNC_ADDR_LAST 0xdd
#define FUNC_ADDR_FIRST 0xe9
-#define PAGE_MAX 0X100
+#define PAGE_MAX 0X400
+#define NEXT_PAGE 0X100
#define MAX_FUNC 0x55
#define CHARGER_CONNECT_BIT (0x1 << 5)
+#define MIN_ANGLE -90
+#define MAX_ANGLE 90
+
+#define BUTTON_0_MASK (1 << 0)
+#define BUTTON_1_MASK (1 << 1)
+#define BUTTON_2_MASK (1 << 2)
+#define BUTTON_3_MASK (1 << 3)
+#define BUTTON_4_MASK (1 << 4)
+#define BUTTON_5_MASK (1 << 5)
+#define BUTTON_6_MASK (1 << 6)
+#define BUTTON_7_MASK (1 << 7)
+
+/* button threshhold limit */
+#define BUTTON_THRESHOLD_LIMIT 1000
+#define BUTTON_THRESHOLD_MIN 0
+
+/* fixed threshold */
+#define BUTTON2_0_THRESHOLD 78
+#define BUTTON2_1_THRESHOLD 50
+
+#if defined(CONFIG_KONA_01_BD)
+#define BUTTON5_0_THRESHOLD 250
+#define BUTTON5_1_THRESHOLD 70
+#define BUTTON5_2_THRESHOLD 220
+#define BUTTON5_3_THRESHOLD 70
+#define BUTTON5_4_THRESHOLD 250
+#else
+#define BUTTON5_0_THRESHOLD 256
+#define BUTTON5_1_THRESHOLD 65
+#define BUTTON5_2_THRESHOLD 400
+#define BUTTON5_3_THRESHOLD 70
+#define BUTTON5_4_THRESHOLD 300
+#endif
+
+enum BUTTON{
+ BUTTON1 = 0,
+ BUTTON2,
+ BUTTON3,
+ BUTTON4,
+ BUTTON5,
+ BUTTON6,
+ BUTTON7,
+ BUTTON8,
+ BUTTON_MAX,
+};
+
enum MT_STATUS {
MT_STATUS_INACTIVE = 0,
MT_STATUS_PRESS,
@@ -69,6 +116,9 @@ struct finger_info {
int w_max;
int z;
int status;
+ int angle;
+ int width;
+
};
struct finger_data {
@@ -123,17 +173,49 @@ struct synaptics_ts_fw_block {
u32 config_imagesize;
};
+#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_S7301_KEYS)
+struct synaptics_button_map {
+ u8 nbuttons;
+ u8 *map;
+};
+
+struct synaptics_extend_button_map {
+ u8 nbuttons;
+ u8 *map;
+ u8 button_mask;
+};
+
+#endif
+
struct synaptics_platform_data {
int gpio_attn;
int max_x;
int max_y;
int max_pressure;
int max_width;
+ bool swap_xy;
+ bool invert_x;
+ bool invert_y;
+#ifdef CONFIG_SEC_TOUCHSCREEN_SURFACE_TOUCH
+ u8 palm_threshold;
+#endif
u16 x_line;
u16 y_line;
int (*set_power)(bool);
void (*hw_reset)(void);
void (*register_cb)(struct charger_callbacks *);
+#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_S7301_KEYLED)
+ void (*led_control)(int);
+ bool led_event;
+#endif
+
+#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_S7301_KEYS)
+ struct synaptics_button_map *button_map;
+ struct synaptics_extend_button_map *extend_button_map;
+ bool support_extend_button;
+ bool enable_extend_button_event;
+ int button_pressure[BUTTON_MAX];
+#endif
};
struct synaptics_drv_data {
@@ -147,11 +229,21 @@ struct synaptics_drv_data {
struct work_struct fw_update_work;
struct function_info f01;
struct function_info f11;
+#if defined (CONFIG_TOUCHSCREEN_SYNAPTICS_S7301_KEYS)
+ struct function_info f1a;
+#endif
struct function_info f34;
struct function_info f54;
+#ifdef CONFIG_SEC_TOUCHSCREEN_SURFACE_TOUCH
+ struct function_info f51;
+#endif
struct delayed_work init_dwork;
struct delayed_work resume_dwork;
struct delayed_work noti_dwork;
+#if defined (CONFIG_TOUCHSCREEN_SYNAPTICS_S7301_WORKAROUND)
+ struct delayed_work reset_dwork;
+ bool firmware_update_check;
+#endif
struct charger_callbacks callbacks;
struct finger_info finger[MAX_MT_CNT];
#if CONFIG_HAS_EARLYSUSPEND
@@ -174,18 +266,22 @@ struct synaptics_drv_data {
u8 cmd_status;
u8 cmd_report_type;
u8 cmd_result[MAX_CMD_SIZE];
- u8 firm_version[4];
+ u8 firm_version[5];
u8 firm_config[13];
u8 *cmd_temp;
u8 *references;
u8 *tx_to_tx;
u8 *tx_to_gnd;
+#if defined(CONFIG_SEC_TOUCHSCREEN_SURFACE_TOUCH)
+ u8 palm_flag;
+#endif
u16 x_line;
u16 y_line;
u16 refer_max;
u16 refer_min;
u16 rx_to_rx[42][42];
unsigned long func_bit[BITS_TO_LONGS(MAX_FUNC+1)];
+ atomic_t keypad_enable;
};
extern struct class *sec_class;
diff --git a/include/linux/sync.h b/include/linux/sync.h
index 4f19938..5f49363 100644
--- a/include/linux/sync.h
+++ b/include/linux/sync.h
@@ -16,8 +16,10 @@
#include <linux/types.h>
#ifdef __KERNEL__
+#include <linux/kref.h>
#include <linux/ktime.h>
#include <linux/list.h>
+#include <linux/seq_file.h>
#include <linux/spinlock.h>
#include <linux/wait.h>
@@ -39,14 +41,14 @@ struct sync_fence;
* -1 if a will signabl before b
* @free_pt: called before sync_pt is freed
* @release_obj: called before sync_timeline is freed
- * @print_obj: print aditional debug information about sync_timeline.
- * should not print a newline
- * @print_pt: print aditional debug information about sync_pt.
- * should not print a newline
+ * @print_obj: deprecated
+ * @print_pt: deprecated
* @fill_driver_data: write implmentation specific driver data to data.
* should return an error if there is not enough room
* as specified by size. This information is returned
* to userspace by SYNC_IOC_FENCE_INFO.
+ * @timeline_value_str: fill str with the value of the sync_timeline's counter
+ * @pt_value_str: fill str with the value of the sync_pt
*/
struct sync_timeline_ops {
const char *driver_name;
@@ -66,19 +68,27 @@ struct sync_timeline_ops {
/* optional */
void (*release_obj)(struct sync_timeline *sync_timeline);
- /* optional */
+ /* deprecated */
void (*print_obj)(struct seq_file *s,
struct sync_timeline *sync_timeline);
- /* optional */
+ /* deprecated */
void (*print_pt)(struct seq_file *s, struct sync_pt *sync_pt);
/* optional */
int (*fill_driver_data)(struct sync_pt *syncpt, void *data, int size);
+
+ /* optional */
+ void (*timeline_value_str)(struct sync_timeline *timeline, char *str,
+ int size);
+
+ /* optional */
+ void (*pt_value_str)(struct sync_pt *pt, char *str, int size);
};
/**
* struct sync_timeline - sync object
+ * @kref: reference count on fence.
* @ops: ops that define the implementaiton of the sync_timeline
* @name: name of the sync_timeline. Useful for debugging
* @destoryed: set when sync_timeline is destroyed
@@ -89,6 +99,7 @@ struct sync_timeline_ops {
* @sync_timeline_list: membership in global sync_timeline_list
*/
struct sync_timeline {
+ struct kref kref;
const struct sync_timeline_ops *ops;
char name[32];
@@ -109,6 +120,7 @@ struct sync_timeline {
* @parent: sync_timeline to which this sync_pt belongs
* @child_list: membership in sync_timeline.child_list_head
* @active_list: membership in sync_timeline.active_list_head
+ * @signaled_list: membership in temorary signaled_list on stack
* @fence: sync_fence to which the sync_pt belongs
* @pt_list: membership in sync_fence.pt_list_head
* @status: 1: signaled, 0:active, <0: error
@@ -120,6 +132,7 @@ struct sync_pt {
struct list_head child_list;
struct list_head active_list;
+ struct list_head signaled_list;
struct sync_fence *fence;
struct list_head pt_list;
@@ -133,6 +146,7 @@ struct sync_pt {
/**
* struct sync_fence - sync fence
* @file: file representing this fence
+ * @kref: referenace count on fence.
* @name: name of sync_fence. Useful for debugging
* @pt_list_head: list of sync_pts in ths fence. immutable once fence
* is created
@@ -145,6 +159,7 @@ struct sync_pt {
*/
struct sync_fence {
struct file *file;
+ struct kref kref;
char name[32];
/* this list is immutable once the fence is created */
@@ -159,6 +174,10 @@ struct sync_fence {
struct list_head sync_fence_list;
};
+struct sync_fence_waiter;
+typedef void (*sync_callback_t)(struct sync_fence *fence,
+ struct sync_fence_waiter *waiter);
+
/**
* struct sync_fence_waiter - metadata for asynchronous waiter on a fence
* @waiter_list: membership in sync_fence.waiter_list_head
@@ -168,10 +187,15 @@ struct sync_fence {
struct sync_fence_waiter {
struct list_head waiter_list;
- void (*callback)(struct sync_fence *fence, void *data);
- void *callback_data;
+ sync_callback_t callback;
};
+static inline void sync_fence_waiter_init(struct sync_fence_waiter *waiter,
+ sync_callback_t callback)
+{
+ waiter->callback = callback;
+}
+
/*
* API for sync_timeline implementers
*/
@@ -284,24 +308,37 @@ void sync_fence_install(struct sync_fence *fence, int fd);
/**
* sync_fence_wait_async() - registers and async wait on the fence
* @fence: fence to wait on
- * @callback: callback
- * @callback_data data to pass to the callback
+ * @waiter: waiter callback struck
*
* Returns 1 if @fence has already signaled.
*
- * Registers a callback to be called when @fence signals or has an error
+ * Registers a callback to be called when @fence signals or has an error.
+ * @waiter should be initialized with sync_fence_waiter_init().
*/
int sync_fence_wait_async(struct sync_fence *fence,
- void (*callback)(struct sync_fence *, void *data),
- void *callback_data);
+ struct sync_fence_waiter *waiter);
+
+/**
+ * sync_fence_cancel_async() - cancels an async wait
+ * @fence: fence to wait on
+ * @waiter: waiter callback struck
+ *
+ * returns 0 if waiter was removed from fence's async waiter list.
+ * returns -ENOENT if waiter was not found on fence's async waiter list.
+ *
+ * Cancels a previously registered async wait. Will fail gracefully if
+ * @waiter was never registered or if @fence has already signaled @waiter.
+ */
+int sync_fence_cancel_async(struct sync_fence *fence,
+ struct sync_fence_waiter *waiter);
/**
* sync_fence_wait() - wait on fence
* @fence: fence to wait on
* @tiemout: timeout in ms
*
- * Wait for @fence to be signaled or have an error. Waits indefintly
- * if @timeout = 0
+ * Wait for @fence to be signaled or have an error. Waits indefinitely
+ * if @timeout < 0
*/
int sync_fence_wait(struct sync_fence *fence, long timeout);
@@ -360,9 +397,9 @@ struct sync_fence_info_data {
/**
* DOC: SYNC_IOC_WAIT - wait for a fence to signal
*
- * pass timeout in milliseconds.
+ * pass timeout in milliseconds. Waits indefinitely timeout < 0.
*/
-#define SYNC_IOC_WAIT _IOW(SYNC_IOC_MAGIC, 0, __u32)
+#define SYNC_IOC_WAIT _IOW(SYNC_IOC_MAGIC, 0, __s32)
/**
* DOC: SYNC_IOC_MERGE - merge two fences
diff --git a/include/linux/wacom_i2c.h b/include/linux/wacom_i2c.h
index 326695a..2b95198 100644
--- a/include/linux/wacom_i2c.h
+++ b/include/linux/wacom_i2c.h
@@ -47,7 +47,11 @@
#define COM_CHECKSUM 0x63
/*I2C address for digitizer and its boot loader*/
-#define WACOM_I2C_ADDR 0x56
+#ifdef CONFIG_EPEN_WACOM_G9PL
+#define WACOM_I2C_BOOT 0x09
+#else
+#define WACOM_I2C_BOOT 0x57
+#endif
#define WACOM_I2C_BOOT 0x57
/*Information for input_dev*/
@@ -73,7 +77,11 @@
#define PDCT_NOSIGNAL 1
#define PDCT_DETECT_PEN 0
+#ifdef CONFIG_MACH_KONA
+#define WACOM_PRESSURE_MAX 1024
+#else
#define WACOM_PRESSURE_MAX 255
+#endif
/*Digitizer Type*/
#define EPEN_DTYPE_B660 1
@@ -272,6 +280,31 @@
#endif
+#elif defined(CONFIG_MACH_KONA)
+
+#define WACOM_DVFS_LOCK_FREQ 800000
+#ifdef CONFIG_SEC_TOUCHSCREEN_DVFS_LOCK
+#define SEC_BUS_LOCK
+#endif
+#define WACOM_HAVE_FWE_PIN
+#define WACOM_USE_SOFTKEY
+
+#define BATTERY_SAVING_MODE
+#define WACOM_CONNECTION_CHECK
+
+#define WACOM_MAX_COORD_X 10804
+#define WACOM_MAX_COORD_Y 17322
+#define WACOM_POSX_OFFSET 100
+#define WACOM_POSY_OFFSET 100
+#define WACOM_MAX_PRESSURE 1023
+
+#define WACOM_IRQ_WORK_AROUND
+#define WACOM_PEN_DETECT
+/* For Android origin */
+#define WACOM_POSX_MAX WACOM_MAX_COORD_Y
+#define WACOM_POSY_MAX WACOM_MAX_COORD_X
+
+#define COOR_WORK_AROUND
#endif /*End of Model config*/
@@ -309,9 +342,9 @@ static struct wacom_features wacom_feature_EMR = {
.y_max = 0x34F8,
.pressure_max = 0xFF,
#else
- .x_max = 16128,
- .y_max = 8448,
- .pressure_max = 256,
+ .x_max = WACOM_MAX_COORD_X,
+ .y_max = WACOM_MAX_COORD_Y,
+ .pressure_max = WACOM_MAX_PRESSURE,
#endif
.comstat = COM_QUERY,
.data = {0, 0, 0, 0, 0, 0, 0},
diff --git a/include/media/sr130pc20_platform.h b/include/media/sr130pc20_platform.h
new file mode 100644
index 0000000..bb4e0d5
--- /dev/null
+++ b/include/media/sr130pc20_platform.h
@@ -0,0 +1,55 @@
+/*
+ * Driver for SR130PC20 (1.3MP camera) from siliconfile
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#define DEFAULT_PIX_FMT V4L2_PIX_FMT_UYVY /* YUV422 */
+#define DEFAULT_MCLK 24000000
+#define SR130PC20_STREAMOFF_DELAY 50
+
+
+enum {
+ SR130PC20_FLASH_MODE_NORMAL,
+ SR130PC20_FLASH_MODE_MOVIE,
+ SR130PC20_FLASH_MODE_MAX,
+};
+
+enum {
+ SR130PC20_FLASH_OFF = 0,
+ SR130PC20_FLASH_ON = 1,
+};
+
+/* Define debug level */
+#define CAMDBG_LEVEL_ERR (1 << 0)
+#define CAMDBG_LEVEL_WARN (1 << 1)
+#define CAMDBG_LEVEL_INFO (1 << 2)
+#define CAMDBG_LEVEL_DEBUG (1 << 3)
+#define CAMDBG_LEVEL_TRACE (1 << 4)
+#define CAMDBG_LEVEL_DEFAULT \
+ (CAMDBG_LEVEL_ERR | CAMDBG_LEVEL_WARN | CAMDBG_LEVEL_INFO)
+
+struct sr130pc20_platform_data {
+ u32 default_width;
+ u32 default_height;
+ u32 pixelformat;
+ u32 freq; /* MCLK in Hz */
+
+ /* This SoC supports Parallel & CSI-2 */
+ u32 is_mipi; /* set to 1 if mipi */
+ s32 streamoff_delay; /* ms, type is signed */
+
+ /* ISP interrupt */
+ /* int (*config_isp_irq)(void);*/
+
+ #define SR130PC20_SUPPORT_FLASH
+ int (*flash_en)(u32 mode, u32 onoff);
+ int (*is_flash_on)(void);
+
+ int (*stby_on)(bool);
+
+ u8 dbg_level;
+};
diff --git a/include/trace/events/sync.h b/include/trace/events/sync.h
new file mode 100644
index 0000000..f31bc63
--- /dev/null
+++ b/include/trace/events/sync.h
@@ -0,0 +1,82 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM sync
+
+#if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_SYNC_H
+
+#include <linux/sync.h>
+#include <linux/tracepoint.h>
+
+TRACE_EVENT(sync_timeline,
+ TP_PROTO(struct sync_timeline *timeline),
+
+ TP_ARGS(timeline),
+
+ TP_STRUCT__entry(
+ __string(name, timeline->name)
+ __array(char, value, 32)
+ ),
+
+ TP_fast_assign(
+ __assign_str(name, timeline->name);
+ if (timeline->ops->timeline_value_str) {
+ timeline->ops->timeline_value_str(timeline,
+ __entry->value,
+ sizeof(__entry->value));
+ } else {
+ __entry->value[0] = '\0';
+ }
+ ),
+
+ TP_printk("name=%s value=%s", __get_str(name), __entry->value)
+);
+
+TRACE_EVENT(sync_wait,
+ TP_PROTO(struct sync_fence *fence, int begin),
+
+ TP_ARGS(fence, begin),
+
+ TP_STRUCT__entry(
+ __string(name, fence->name)
+ __field(s32, status)
+ __field(u32, begin)
+ ),
+
+ TP_fast_assign(
+ __assign_str(name, fence->name);
+ __entry->status = fence->status;
+ __entry->begin = begin;
+ ),
+
+ TP_printk("%s name=%s state=%d", __entry->begin ? "begin" : "end",
+ __get_str(name), __entry->status)
+);
+
+TRACE_EVENT(sync_pt,
+ TP_PROTO(struct sync_pt *pt),
+
+ TP_ARGS(pt),
+
+ TP_STRUCT__entry(
+ __string(timeline, pt->parent->name)
+ __array(char, value, 32)
+ ),
+
+ TP_fast_assign(
+ __assign_str(timeline, pt->parent->name);
+ if (pt->parent->ops->pt_value_str) {
+ pt->parent->ops->pt_value_str(pt,
+ __entry->value,
+ sizeof(__entry->value));
+ } else {
+ __entry->value[0] = '\0';
+ }
+ ),
+
+ TP_printk("name=%s value=%s", __get_str(timeline), __entry->value)
+ );
+
+#endif /* if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ) */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>