Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
pwm-tiehrpwm.c File Reference
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>
#include <linux/io.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/pm_runtime.h>

Go to the source code of this file.

Data Structures

struct  ehrpwm_pwm_chip
 

Macros

#define TBCTL   0x00
 
#define TBPRD   0x0A
 
#define TBCTL_RUN_MASK   (BIT(15) | BIT(14))
 
#define TBCTL_STOP_NEXT   0
 
#define TBCTL_STOP_ON_CYCLE   BIT(14)
 
#define TBCTL_FREE_RUN   (BIT(15) | BIT(14))
 
#define TBCTL_PRDLD_MASK   BIT(3)
 
#define TBCTL_PRDLD_SHDW   0
 
#define TBCTL_PRDLD_IMDT   BIT(3)
 
#define TBCTL_CLKDIV_MASK
 
#define TBCTL_CTRMODE_MASK   (BIT(1) | BIT(0))
 
#define TBCTL_CTRMODE_UP   0
 
#define TBCTL_CTRMODE_DOWN   BIT(0)
 
#define TBCTL_CTRMODE_UPDOWN   BIT(1)
 
#define TBCTL_CTRMODE_FREEZE   (BIT(1) | BIT(0))
 
#define TBCTL_HSPCLKDIV_SHIFT   7
 
#define TBCTL_CLKDIV_SHIFT   10
 
#define CLKDIV_MAX   7
 
#define HSPCLKDIV_MAX   7
 
#define PERIOD_MAX   0xFFFF
 
#define CMPA   0x12
 
#define CMPB   0x14
 
#define AQCTLA   0x16
 
#define AQCTLB   0x18
 
#define AQSFRC   0x1A
 
#define AQCSFRC   0x1C
 
#define AQCTL_CBU_MASK   (BIT(9) | BIT(8))
 
#define AQCTL_CBU_FRCLOW   BIT(8)
 
#define AQCTL_CBU_FRCHIGH   BIT(9)
 
#define AQCTL_CBU_FRCTOGGLE   (BIT(9) | BIT(8))
 
#define AQCTL_CAU_MASK   (BIT(5) | BIT(4))
 
#define AQCTL_CAU_FRCLOW   BIT(4)
 
#define AQCTL_CAU_FRCHIGH   BIT(5)
 
#define AQCTL_CAU_FRCTOGGLE   (BIT(5) | BIT(4))
 
#define AQCTL_PRD_MASK   (BIT(3) | BIT(2))
 
#define AQCTL_PRD_FRCLOW   BIT(2)
 
#define AQCTL_PRD_FRCHIGH   BIT(3)
 
#define AQCTL_PRD_FRCTOGGLE   (BIT(3) | BIT(2))
 
#define AQCTL_ZRO_MASK   (BIT(1) | BIT(0))
 
#define AQCTL_ZRO_FRCLOW   BIT(0)
 
#define AQCTL_ZRO_FRCHIGH   BIT(1)
 
#define AQCTL_ZRO_FRCTOGGLE   (BIT(1) | BIT(0))
 
#define AQCTL_CHANA_POLNORMAL
 
#define AQCTL_CHANA_POLINVERSED
 
#define AQCTL_CHANB_POLNORMAL
 
#define AQCTL_CHANB_POLINVERSED
 
#define AQSFRC_RLDCSF_MASK   (BIT(7) | BIT(6))
 
#define AQSFRC_RLDCSF_ZRO   0
 
#define AQSFRC_RLDCSF_PRD   BIT(6)
 
#define AQSFRC_RLDCSF_ZROPRD   BIT(7)
 
#define AQSFRC_RLDCSF_IMDT   (BIT(7) | BIT(6))
 
#define AQCSFRC_CSFB_MASK   (BIT(3) | BIT(2))
 
#define AQCSFRC_CSFB_FRCDIS   0
 
#define AQCSFRC_CSFB_FRCLOW   BIT(2)
 
#define AQCSFRC_CSFB_FRCHIGH   BIT(3)
 
#define AQCSFRC_CSFB_DISSWFRC   (BIT(3) | BIT(2))
 
#define AQCSFRC_CSFA_MASK   (BIT(1) | BIT(0))
 
#define AQCSFRC_CSFA_FRCDIS   0
 
#define AQCSFRC_CSFA_FRCLOW   BIT(0)
 
#define AQCSFRC_CSFA_FRCHIGH   BIT(1)
 
#define AQCSFRC_CSFA_DISSWFRC   (BIT(1) | BIT(0))
 
#define NUM_PWM_CHANNEL   2 /* EHRPWM channels */
 

Functions

 module_platform_driver (ehrpwm_pwm_driver)
 
 MODULE_DESCRIPTION ("EHRPWM PWM driver")
 
 MODULE_AUTHOR ("Texas Instruments")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define AQCSFRC   0x1C

Definition at line 65 of file pwm-tiehrpwm.c.

#define AQCSFRC_CSFA_DISSWFRC   (BIT(1) | BIT(0))

Definition at line 108 of file pwm-tiehrpwm.c.

#define AQCSFRC_CSFA_FRCDIS   0

Definition at line 105 of file pwm-tiehrpwm.c.

#define AQCSFRC_CSFA_FRCHIGH   BIT(1)

Definition at line 107 of file pwm-tiehrpwm.c.

#define AQCSFRC_CSFA_FRCLOW   BIT(0)

Definition at line 106 of file pwm-tiehrpwm.c.

#define AQCSFRC_CSFA_MASK   (BIT(1) | BIT(0))

Definition at line 104 of file pwm-tiehrpwm.c.

#define AQCSFRC_CSFB_DISSWFRC   (BIT(3) | BIT(2))

Definition at line 103 of file pwm-tiehrpwm.c.

#define AQCSFRC_CSFB_FRCDIS   0

Definition at line 100 of file pwm-tiehrpwm.c.

#define AQCSFRC_CSFB_FRCHIGH   BIT(3)

Definition at line 102 of file pwm-tiehrpwm.c.

#define AQCSFRC_CSFB_FRCLOW   BIT(2)

Definition at line 101 of file pwm-tiehrpwm.c.

#define AQCSFRC_CSFB_MASK   (BIT(3) | BIT(2))

Definition at line 99 of file pwm-tiehrpwm.c.

#define AQCTL_CAU_FRCHIGH   BIT(5)

Definition at line 73 of file pwm-tiehrpwm.c.

#define AQCTL_CAU_FRCLOW   BIT(4)

Definition at line 72 of file pwm-tiehrpwm.c.

#define AQCTL_CAU_FRCTOGGLE   (BIT(5) | BIT(4))

Definition at line 74 of file pwm-tiehrpwm.c.

#define AQCTL_CAU_MASK   (BIT(5) | BIT(4))

Definition at line 71 of file pwm-tiehrpwm.c.

#define AQCTL_CBU_FRCHIGH   BIT(9)

Definition at line 69 of file pwm-tiehrpwm.c.

#define AQCTL_CBU_FRCLOW   BIT(8)

Definition at line 68 of file pwm-tiehrpwm.c.

#define AQCTL_CBU_FRCTOGGLE   (BIT(9) | BIT(8))

Definition at line 70 of file pwm-tiehrpwm.c.

#define AQCTL_CBU_MASK   (BIT(9) | BIT(8))

Definition at line 67 of file pwm-tiehrpwm.c.

#define AQCTL_CHANA_POLINVERSED
Value:
AQCTL_ZRO_FRCLOW)

Definition at line 86 of file pwm-tiehrpwm.c.

#define AQCTL_CHANA_POLNORMAL
Value:
AQCTL_ZRO_FRCHIGH)

Definition at line 84 of file pwm-tiehrpwm.c.

#define AQCTL_CHANB_POLINVERSED
Value:
AQCTL_ZRO_FRCLOW)

Definition at line 90 of file pwm-tiehrpwm.c.

#define AQCTL_CHANB_POLNORMAL
Value:
AQCTL_ZRO_FRCHIGH)

Definition at line 88 of file pwm-tiehrpwm.c.

#define AQCTL_PRD_FRCHIGH   BIT(3)

Definition at line 77 of file pwm-tiehrpwm.c.

#define AQCTL_PRD_FRCLOW   BIT(2)

Definition at line 76 of file pwm-tiehrpwm.c.

#define AQCTL_PRD_FRCTOGGLE   (BIT(3) | BIT(2))

Definition at line 78 of file pwm-tiehrpwm.c.

#define AQCTL_PRD_MASK   (BIT(3) | BIT(2))

Definition at line 75 of file pwm-tiehrpwm.c.

#define AQCTL_ZRO_FRCHIGH   BIT(1)

Definition at line 81 of file pwm-tiehrpwm.c.

#define AQCTL_ZRO_FRCLOW   BIT(0)

Definition at line 80 of file pwm-tiehrpwm.c.

#define AQCTL_ZRO_FRCTOGGLE   (BIT(1) | BIT(0))

Definition at line 82 of file pwm-tiehrpwm.c.

#define AQCTL_ZRO_MASK   (BIT(1) | BIT(0))

Definition at line 79 of file pwm-tiehrpwm.c.

#define AQCTLA   0x16

Definition at line 62 of file pwm-tiehrpwm.c.

#define AQCTLB   0x18

Definition at line 63 of file pwm-tiehrpwm.c.

#define AQSFRC   0x1A

Definition at line 64 of file pwm-tiehrpwm.c.

#define AQSFRC_RLDCSF_IMDT   (BIT(7) | BIT(6))

Definition at line 97 of file pwm-tiehrpwm.c.

#define AQSFRC_RLDCSF_MASK   (BIT(7) | BIT(6))

Definition at line 93 of file pwm-tiehrpwm.c.

#define AQSFRC_RLDCSF_PRD   BIT(6)

Definition at line 95 of file pwm-tiehrpwm.c.

#define AQSFRC_RLDCSF_ZRO   0

Definition at line 94 of file pwm-tiehrpwm.c.

#define AQSFRC_RLDCSF_ZROPRD   BIT(7)

Definition at line 96 of file pwm-tiehrpwm.c.

#define CLKDIV_MAX   7

Definition at line 53 of file pwm-tiehrpwm.c.

#define CMPA   0x12

Definition at line 58 of file pwm-tiehrpwm.c.

#define CMPB   0x14

Definition at line 59 of file pwm-tiehrpwm.c.

#define HSPCLKDIV_MAX   7

Definition at line 54 of file pwm-tiehrpwm.c.

#define NUM_PWM_CHANNEL   2 /* EHRPWM channels */

Definition at line 110 of file pwm-tiehrpwm.c.

#define PERIOD_MAX   0xFFFF

Definition at line 55 of file pwm-tiehrpwm.c.

#define TBCTL   0x00

Definition at line 32 of file pwm-tiehrpwm.c.

#define TBCTL_CLKDIV_MASK
Value:
(BIT(12) | BIT(11) | BIT(10) | BIT(9) | \
BIT(8) | BIT(7))

Definition at line 42 of file pwm-tiehrpwm.c.

#define TBCTL_CLKDIV_SHIFT   10

Definition at line 51 of file pwm-tiehrpwm.c.

#define TBCTL_CTRMODE_DOWN   BIT(0)

Definition at line 46 of file pwm-tiehrpwm.c.

#define TBCTL_CTRMODE_FREEZE   (BIT(1) | BIT(0))

Definition at line 48 of file pwm-tiehrpwm.c.

#define TBCTL_CTRMODE_MASK   (BIT(1) | BIT(0))

Definition at line 44 of file pwm-tiehrpwm.c.

#define TBCTL_CTRMODE_UP   0

Definition at line 45 of file pwm-tiehrpwm.c.

#define TBCTL_CTRMODE_UPDOWN   BIT(1)

Definition at line 47 of file pwm-tiehrpwm.c.

#define TBCTL_FREE_RUN   (BIT(15) | BIT(14))

Definition at line 38 of file pwm-tiehrpwm.c.

#define TBCTL_HSPCLKDIV_SHIFT   7

Definition at line 50 of file pwm-tiehrpwm.c.

#define TBCTL_PRDLD_IMDT   BIT(3)

Definition at line 41 of file pwm-tiehrpwm.c.

#define TBCTL_PRDLD_MASK   BIT(3)

Definition at line 39 of file pwm-tiehrpwm.c.

#define TBCTL_PRDLD_SHDW   0

Definition at line 40 of file pwm-tiehrpwm.c.

#define TBCTL_RUN_MASK   (BIT(15) | BIT(14))

Definition at line 35 of file pwm-tiehrpwm.c.

#define TBCTL_STOP_NEXT   0

Definition at line 36 of file pwm-tiehrpwm.c.

#define TBCTL_STOP_ON_CYCLE   BIT(14)

Definition at line 37 of file pwm-tiehrpwm.c.

#define TBPRD   0x0A

Definition at line 33 of file pwm-tiehrpwm.c.

Function Documentation

MODULE_AUTHOR ( "Texas Instruments"  )
MODULE_DESCRIPTION ( "EHRPWM PWM driver )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( ehrpwm_pwm_driver  )