Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
core.c File Reference
#include <linux/module.h>
#include <linux/pwm.h>
#include <linux/radix-tree.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>

Go to the source code of this file.

Macros

#define MAX_PWMS   1024
 

Functions

int pwm_set_chip_data (struct pwm_device *pwm, void *data)
 
voidpwm_get_chip_data (struct pwm_device *pwm)
 
int pwmchip_add (struct pwm_chip *chip)
 
 EXPORT_SYMBOL_GPL (pwmchip_add)
 
int pwmchip_remove (struct pwm_chip *chip)
 
 EXPORT_SYMBOL_GPL (pwmchip_remove)
 
struct pwm_devicepwm_request (int pwm, const char *label)
 
 EXPORT_SYMBOL_GPL (pwm_request)
 
struct pwm_devicepwm_request_from_chip (struct pwm_chip *chip, unsigned int index, const char *label)
 
 EXPORT_SYMBOL_GPL (pwm_request_from_chip)
 
void pwm_free (struct pwm_device *pwm)
 
 EXPORT_SYMBOL_GPL (pwm_free)
 
int pwm_config (struct pwm_device *pwm, int duty_ns, int period_ns)
 
 EXPORT_SYMBOL_GPL (pwm_config)
 
int pwm_set_polarity (struct pwm_device *pwm, enum pwm_polarity polarity)
 
 EXPORT_SYMBOL_GPL (pwm_set_polarity)
 
int pwm_enable (struct pwm_device *pwm)
 
 EXPORT_SYMBOL_GPL (pwm_enable)
 
void pwm_disable (struct pwm_device *pwm)
 
 EXPORT_SYMBOL_GPL (pwm_disable)
 
void __init pwm_add_table (struct pwm_lookup *table, size_t num)
 
struct pwm_devicepwm_get (struct device *dev, const char *con_id)
 
 EXPORT_SYMBOL_GPL (pwm_get)
 
void pwm_put (struct pwm_device *pwm)
 
 EXPORT_SYMBOL_GPL (pwm_put)
 
struct pwm_devicedevm_pwm_get (struct device *dev, const char *con_id)
 
 EXPORT_SYMBOL_GPL (devm_pwm_get)
 
void devm_pwm_put (struct device *dev, struct pwm_device *pwm)
 
 EXPORT_SYMBOL_GPL (devm_pwm_put)
 

Macro Definition Documentation

#define MAX_PWMS   1024

Definition at line 33 of file core.c.

Function Documentation

struct pwm_device* devm_pwm_get ( struct device dev,
const char con_id 
)
read

devm_pwm_get() - resource managed pwm_get() : device for PWM consumer : consumer name

This function performs like pwm_get() but the acquired PWM device will automatically be released on driver detach.

Definition at line 662 of file core.c.

void devm_pwm_put ( struct device dev,
struct pwm_device pwm 
)

devm_pwm_put() - resource managed pwm_put() : device for PWM consumer : PWM device

Release a PWM previously allocated using devm_pwm_get(). Calling this function is usually not needed because devm-allocated resources are automatically released on driver detach.

Definition at line 701 of file core.c.

EXPORT_SYMBOL_GPL ( pwmchip_add  )
EXPORT_SYMBOL_GPL ( pwmchip_remove  )
EXPORT_SYMBOL_GPL ( pwm_request  )
EXPORT_SYMBOL_GPL ( pwm_request_from_chip  )
EXPORT_SYMBOL_GPL ( pwm_free  )
EXPORT_SYMBOL_GPL ( pwm_config  )
EXPORT_SYMBOL_GPL ( pwm_set_polarity  )
EXPORT_SYMBOL_GPL ( pwm_enable  )
EXPORT_SYMBOL_GPL ( pwm_disable  )
EXPORT_SYMBOL_GPL ( pwm_get  )
EXPORT_SYMBOL_GPL ( pwm_put  )
EXPORT_SYMBOL_GPL ( devm_pwm_get  )
EXPORT_SYMBOL_GPL ( devm_pwm_put  )
void __init pwm_add_table ( struct pwm_lookup table,
size_t  num 
)

pwm_add_table() - register PWM device consumers : array of consumers to register : number of consumers in table

Definition at line 525 of file core.c.

int pwm_config ( struct pwm_device pwm,
int  duty_ns,
int  period_ns 
)

pwm_config() - change a PWM device configuration : PWM device : "on" time (in nanoseconds) : duration (in nanoseconds) of one cycle

Definition at line 372 of file core.c.

void pwm_disable ( struct pwm_device pwm)

pwm_disable() - stop a PWM output toggling : PWM device

Definition at line 420 of file core.c.

int pwm_enable ( struct pwm_device pwm)

pwm_enable() - start a PWM output toggling : PWM device

Definition at line 407 of file core.c.

void pwm_free ( struct pwm_device pwm)

pwm_free() - free a PWM device : PWM device

This function is deprecated, use pwm_put() instead.

Definition at line 360 of file core.c.

struct pwm_device* pwm_get ( struct device dev,
const char con_id 
)
read

pwm_get() - look up and request a PWM device : device for PWM consumer : consumer name

Lookup is first attempted using DT. If the device was not instantiated from a device tree, a PWM chip and a relative index is looked up via a table supplied by board setup code (see pwm_add_table()).

Once a PWM chip has been found the specified PWM device will be requested and is ready to be used.

Definition at line 549 of file core.c.

void* pwm_get_chip_data ( struct pwm_device pwm)

pwm_get_chip_data() - get private chip data for a PWM : PWM device

Definition at line 190 of file core.c.

void pwm_put ( struct pwm_device pwm)

pwm_put() - release a PWM device : PWM device

Definition at line 626 of file core.c.

struct pwm_device* pwm_request ( int  pwm,
const char label 
)
read

pwm_request() - request a PWM device : global PWM device index : PWM device label

This function is deprecated, use pwm_get() instead.

Definition at line 295 of file core.c.

struct pwm_device* pwm_request_from_chip ( struct pwm_chip chip,
unsigned int  index,
const char label 
)
read

pwm_request_from_chip() - request a PWM device relative to a PWM chip : PWM chip : per-chip index of the PWM to request : a literal description string of this PWM

Returns the PWM at the given index of the given PWM chip. A negative error code is returned if the index is not valid for the specified PWM chip or if the PWM device cannot be requested.

Definition at line 332 of file core.c.

int pwm_set_chip_data ( struct pwm_device pwm,
void data 
)

pwm_set_chip_data() - set private chip data for a PWM : PWM device : pointer to chip-specific data

Definition at line 176 of file core.c.

int pwm_set_polarity ( struct pwm_device pwm,
enum pwm_polarity  polarity 
)

pwm_set_polarity() - configure the polarity of a PWM signal : PWM device : new polarity of the PWM signal

Note that the polarity cannot be configured while the PWM device is enabled

Definition at line 388 of file core.c.

int pwmchip_add ( struct pwm_chip chip)

pwmchip_add() - register a new PWM chip : the PWM chip to add

Register a new PWM chip. If chip->base < 0 then a dynamically assigned base will be used.

Definition at line 202 of file core.c.

int pwmchip_remove ( struct pwm_chip chip)

pwmchip_remove() - remove a PWM chip : the PWM chip to remove

Removes a PWM chip. This function may return busy if the PWM chip provides a PWM device that is still requested.

Definition at line 259 of file core.c.