#define DEFAULT_SYMBOL_NAMESPACE …
#include <linux/acpi.h>
#include <linux/module.h>
#include <linux/idr.h>
#include <linux/of.h>
#include <linux/pwm.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/device.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <dt-bindings/pwm/pwm.h>
#define CREATE_TRACE_POINTS
#include <trace/events/pwm.h>
static DEFINE_MUTEX(pwm_lock);
static DEFINE_IDR(pwm_chips);
static void pwm_apply_debug(struct pwm_device *pwm,
const struct pwm_state *state)
{ … }
static bool pwm_state_valid(const struct pwm_state *state)
{ … }
static int __pwm_apply(struct pwm_device *pwm, const struct pwm_state *state)
{ … }
int pwm_apply_might_sleep(struct pwm_device *pwm, const struct pwm_state *state)
{ … }
EXPORT_SYMBOL_GPL(…);
int pwm_apply_atomic(struct pwm_device *pwm, const struct pwm_state *state)
{ … }
EXPORT_SYMBOL_GPL(…);
int pwm_adjust_config(struct pwm_device *pwm)
{ … }
EXPORT_SYMBOL_GPL(…);
int pwm_capture(struct pwm_device *pwm, struct pwm_capture *result,
unsigned long timeout)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct pwm_chip *pwmchip_find_by_name(const char *name)
{ … }
static int pwm_device_request(struct pwm_device *pwm, const char *label)
{ … }
static struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
unsigned int index,
const char *label)
{ … }
struct pwm_device *
of_pwm_xlate_with_flags(struct pwm_chip *chip, const struct of_phandle_args *args)
{ … }
EXPORT_SYMBOL_GPL(…);
struct pwm_device *
of_pwm_single_xlate(struct pwm_chip *chip, const struct of_phandle_args *args)
{ … }
EXPORT_SYMBOL_GPL(…);
struct pwm_export { … };
static inline struct pwm_chip *pwmchip_from_dev(struct device *pwmchip_dev)
{ … }
static inline struct pwm_export *pwmexport_from_dev(struct device *pwm_dev)
{ … }
static inline struct pwm_device *pwm_from_dev(struct device *pwm_dev)
{ … }
static ssize_t period_show(struct device *pwm_dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t period_store(struct device *pwm_dev,
struct device_attribute *attr,
const char *buf, size_t size)
{ … }
static ssize_t duty_cycle_show(struct device *pwm_dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t duty_cycle_store(struct device *pwm_dev,
struct device_attribute *attr,
const char *buf, size_t size)
{ … }
static ssize_t enable_show(struct device *pwm_dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t enable_store(struct device *pwm_dev,
struct device_attribute *attr,
const char *buf, size_t size)
{ … }
static ssize_t polarity_show(struct device *pwm_dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t polarity_store(struct device *pwm_dev,
struct device_attribute *attr,
const char *buf, size_t size)
{ … }
static ssize_t capture_show(struct device *pwm_dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RW(period);
static DEVICE_ATTR_RW(duty_cycle);
static DEVICE_ATTR_RW(enable);
static DEVICE_ATTR_RW(polarity);
static DEVICE_ATTR_RO(capture);
static struct attribute *pwm_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static void pwm_export_release(struct device *pwm_dev)
{ … }
static int pwm_export_child(struct device *pwmchip_dev, struct pwm_device *pwm)
{ … }
static int pwm_unexport_match(struct device *pwm_dev, void *data)
{ … }
static int pwm_unexport_child(struct device *pwmchip_dev, struct pwm_device *pwm)
{ … }
static ssize_t export_store(struct device *pwmchip_dev,
struct device_attribute *attr,
const char *buf, size_t len)
{ … }
static DEVICE_ATTR_WO(export);
static ssize_t unexport_store(struct device *pwmchip_dev,
struct device_attribute *attr,
const char *buf, size_t len)
{ … }
static DEVICE_ATTR_WO(unexport);
static ssize_t npwm_show(struct device *pwmchip_dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(npwm);
static struct attribute *pwm_chip_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static struct pwm_export *pwm_class_get_state(struct device *pwmchip_dev,
struct pwm_device *pwm,
struct pwm_state *state)
{ … }
static int pwm_class_apply_state(struct pwm_export *export,
struct pwm_device *pwm,
struct pwm_state *state)
{ … }
static int pwm_class_resume_npwm(struct device *pwmchip_dev, unsigned int npwm)
{ … }
static int pwm_class_suspend(struct device *pwmchip_dev)
{ … }
static int pwm_class_resume(struct device *pwmchip_dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(pwm_class_pm_ops, pwm_class_suspend, pwm_class_resume);
static struct class pwm_class = …;
static void pwmchip_sysfs_unexport(struct pwm_chip *chip)
{ … }
#define PWMCHIP_ALIGN …
static void *pwmchip_priv(struct pwm_chip *chip)
{ … }
void pwmchip_put(struct pwm_chip *chip)
{ … }
EXPORT_SYMBOL_GPL(…);
static void pwmchip_release(struct device *pwmchip_dev)
{ … }
struct pwm_chip *pwmchip_alloc(struct device *parent, unsigned int npwm, size_t sizeof_priv)
{ … }
EXPORT_SYMBOL_GPL(…);
static void devm_pwmchip_put(void *data)
{ … }
struct pwm_chip *devm_pwmchip_alloc(struct device *parent, unsigned int npwm, size_t sizeof_priv)
{ … }
EXPORT_SYMBOL_GPL(…);
static void of_pwmchip_add(struct pwm_chip *chip)
{ … }
static void of_pwmchip_remove(struct pwm_chip *chip)
{ … }
static bool pwm_ops_check(const struct pwm_chip *chip)
{ … }
int __pwmchip_add(struct pwm_chip *chip, struct module *owner)
{ … }
EXPORT_SYMBOL_GPL(…);
void pwmchip_remove(struct pwm_chip *chip)
{ … }
EXPORT_SYMBOL_GPL(…);
static void devm_pwmchip_remove(void *data)
{ … }
int __devm_pwmchip_add(struct device *dev, struct pwm_chip *chip, struct module *owner)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct device_link *pwm_device_link_add(struct device *dev,
struct pwm_device *pwm)
{ … }
static struct pwm_chip *fwnode_to_pwmchip(struct fwnode_handle *fwnode)
{ … }
static struct pwm_device *of_pwm_get(struct device *dev, struct device_node *np,
const char *con_id)
{ … }
static struct pwm_device *acpi_pwm_get(const struct fwnode_handle *fwnode)
{ … }
static DEFINE_MUTEX(pwm_lookup_lock);
static LIST_HEAD(pwm_lookup_list);
void pwm_add_table(struct pwm_lookup *table, size_t num)
{ … }
void pwm_remove_table(struct pwm_lookup *table, size_t num)
{ … }
struct pwm_device *pwm_get(struct device *dev, const char *con_id)
{ … }
EXPORT_SYMBOL_GPL(…);
void pwm_put(struct pwm_device *pwm)
{ … }
EXPORT_SYMBOL_GPL(…);
static void devm_pwm_release(void *pwm)
{ … }
struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id)
{ … }
EXPORT_SYMBOL_GPL(…);
struct pwm_device *devm_fwnode_pwm_get(struct device *dev,
struct fwnode_handle *fwnode,
const char *con_id)
{ … }
EXPORT_SYMBOL_GPL(…);
static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s)
{ … }
static void *pwm_seq_start(struct seq_file *s, loff_t *pos)
{ … }
static void *pwm_seq_next(struct seq_file *s, void *v, loff_t *pos)
{ … }
static void pwm_seq_stop(struct seq_file *s, void *v)
{ … }
static int pwm_seq_show(struct seq_file *s, void *v)
{ … }
static const struct seq_operations pwm_debugfs_sops = …;
DEFINE_SEQ_ATTRIBUTE(…);
static int __init pwm_init(void)
{ … }
subsys_initcall(pwm_init);