summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKe Qinghua <qinghua.ke@freescale.com>2014-06-17 13:16:44 +0800
committerKe Qinghua <qinghua.ke@freescale.com>2014-06-17 13:28:10 +0800
commitd83aa771d5d897b2901518ac06cf88e1d2da092d (patch)
tree55c0a641dd03ac7d0e26f4ea50bf3a39acc4f812 /include
parentd0417b9e94ca630ec2f0eba85bff481d844afa1b (diff)
ENGR00305254 imx6sx sarbesd board bring up
Enable Consume IR for kernel 3.10 Signed-off-by: Ke Qinghua <qinghua.ke@freescale.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ir.h51
-rw-r--r--include/linux/pwm.h10
2 files changed, 61 insertions, 0 deletions
diff --git a/include/linux/ir.h b/include/linux/ir.h
new file mode 100644
index 000000000000..5311cffd7adb
--- /dev/null
+++ b/include/linux/ir.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2005-2014 Freescale Semiconductor, Inc. All Rights Reserved.
+ */
+/*
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+#ifndef _LINUX_IR_H
+#define _LINUX_IR_H
+
+#include <linux/types.h>
+#ifdef __KERNEL__
+#include <linux/kgdb.h>
+#endif /* __KERNEL__ */
+
+#define IR_MAGIC 'I'
+
+#define IR_GET_CARRIER_FREQS _IO(IR_MAGIC, 0x01)
+#define IR_GET_CARRIER_FREQS_NUM _IO(IR_MAGIC, 0x02)
+#define IR_DATA_TRANSMIT _IO(IR_MAGIC, 0x03)
+#define IR_CFG_CARRIER _IO(IR_MAGIC, 0x04)
+
+struct ir_data_pattern {
+ int len;
+ int *pattern;
+};
+
+struct ir_carrier_freq {
+ /* carrier frequence id */
+ int id;
+ /* ir support min carrier freq */
+ int min;
+ /* ir support max carrier freq */
+ int max;
+};
+
+#ifdef __KERNEL__
+extern void ir_device_register(const char *name, struct device *parent, void *devdata);
+extern void ir_device_unregister(void);
+extern int ir_config(void *dev, int carry_freq);
+extern int ir_get_num_carrier_freqs(void);
+extern int ir_get_carrier_range(int id, int *min, int *max);
+extern int ir_transmit(void *dev, int len, int *pattern, unsigned char start_level);
+#endif
+
+#endif /* _LINUX_IR_H */
+
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index a4df2042b79c..b126bce91796 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -32,6 +32,11 @@ int pwm_enable(struct pwm_device *pwm);
* pwm_disable - stop a PWM output toggling
*/
void pwm_disable(struct pwm_device *pwm);
+
+/*
+ * pwm_out_enable - enable/disable PWM output pin
+ */
+ void pwm_out_enable(struct pwm_device *pwm, bool enable);
#else
static inline struct pwm_device *pwm_request(int pwm_id, const char *label)
{
@@ -55,6 +60,10 @@ static inline int pwm_enable(struct pwm_device *pwm)
static inline void pwm_disable(struct pwm_device *pwm)
{
}
+
+static inline void pwm_out_enable(struct pwm_device *pwm, bool enable)
+{
+}
#endif
struct pwm_chip;
@@ -131,6 +140,7 @@ struct pwm_ops {
struct pwm_device *pwm);
void (*disable)(struct pwm_chip *chip,
struct pwm_device *pwm);
+ void (*out_enable)(struct pwm_chip *pwm, bool enable);
#ifdef CONFIG_DEBUG_FS
void (*dbg_show)(struct pwm_chip *chip,
struct seq_file *s);