summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRobby Cai <R63905@freescale.com>2011-07-29 13:33:09 +0800
committerRobby Cai <R63905@freescale.com>2011-07-29 15:19:54 +0800
commitc20f3bc3abb98e7d141d7e255b81b66a5b4b6293 (patch)
tree5b261eb67c53ebbbf922d7672336a1daa5af528c /include
parent01be6c83fb20d28a9da4dccf99737fae75169101 (diff)
ENGR00153921 Add MC34708 PWM support
This driver privides dedicated APIs similar to ones provided by Linux PWM framework. MC34708 PWM supports period of time from 16000 ns to 1024000 ns, with the step of 16000 ns. The duty cycle is multiple of 1/32. Signed-off-by: Robby Cai <R63905@freescale.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/mc34708/mc34708_pwm.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/include/linux/mfd/mc34708/mc34708_pwm.h b/include/linux/mfd/mc34708/mc34708_pwm.h
new file mode 100644
index 000000000000..9d69addf5d27
--- /dev/null
+++ b/include/linux/mfd/mc34708/mc34708_pwm.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * based on arch/arm/plat-mxc/pwm.c
+ */
+
+#ifndef __MC34708_PWM_H
+#define __MC34708_PWM_H
+
+struct pwm_device;
+
+/*
+ * pwm_request - request a PWM device
+ */
+struct pwm_device *mc34708_pwm_request(int pwm_id, const char *label);
+
+/*
+ * pwm_free - free a PWM device
+ */
+void mc34708_pwm_free(struct pwm_device *pwm);
+
+/*
+ * pwm_config - change a PWM device configuration
+ */
+int mc34708_pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns);
+
+/*
+ * pwm_enable - start a PWM output toggling
+ */
+int mc34708_pwm_enable(struct pwm_device *pwm);
+
+/*
+ * pwm_disable - stop a PWM output toggling
+ */
+void mc34708_pwm_disable(struct pwm_device *pwm);
+
+#endif /* __MC34708_PWM_H */