diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-19 17:48:32 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-19 17:48:32 -0700 |
commit | fb20871a54961b82d35303b43452928186c1361d (patch) | |
tree | 1beeb39e45eda1c8b5893090904b583fceeb07ef /drivers/staging/cpc-usb/sja2m16c.h | |
parent | bee89ab228e6f51c4ddd3481b9bd491859a8ee7b (diff) | |
parent | c7a5d70796379e3d51d0c652fbe1634b81d3bbd5 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (342 commits)
Staging: comedi: fix build errors
Staging: udlfb: update to version 0.2.3
Staging: udlfb: fix some sparse warnings.
Staging: udlfb: clean up checkpatch warnings in udlfb.c
Staging: udlfb: clean up checkpatch warnings in udlfb.h
Staging: udlfb: add udlfb driver to build
Staging: add udlfb driver
Staging: pata_rdc: remove pointless comments
Staging: pata_rdc: remove DRIVER macros
Staging: pata_rdc: remove dbgprintf macro
Staging: pata_rdc: remove broken flag
Staging: pata_rdc: fix build warnings
Staging: pata_rdc: use PCI_DEVICE
Staging: pata_rdc: remove function prototypes
Staging: pata_rdc: coding style fixes
Staging: pata_rdc: convert code to work in 2.6.29
Staging: pata_rdc: add driver to the build system
Staging: add pata_rdc driver
Staging: remove obsolete serqt_usb driver
Staging: serqt_usb2 add the driver to the build
...
Diffstat (limited to 'drivers/staging/cpc-usb/sja2m16c.h')
-rw-r--r-- | drivers/staging/cpc-usb/sja2m16c.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/staging/cpc-usb/sja2m16c.h b/drivers/staging/cpc-usb/sja2m16c.h new file mode 100644 index 00000000000..654bd3fc91d --- /dev/null +++ b/drivers/staging/cpc-usb/sja2m16c.h @@ -0,0 +1,41 @@ +#ifndef _SJA2M16C_H +#define _SJA2M16C_H + +#include "cpc.h" + +#define BAUDRATE_TOLERANCE_PERCENT 1 +#define SAMPLEPOINT_TOLERANCE_PERCENT 5 +#define SAMPLEPOINT_UPPER_LIMIT 88 + +/* M16C parameters */ +struct FIELD_C0CONR { + unsigned int brp:4; + unsigned int sam:1; + unsigned int pr:3; + unsigned int dummy:8; +}; +struct FIELD_C1CONR { + unsigned int ph1:3; + unsigned int ph2:3; + unsigned int sjw:2; + unsigned int dummy:8; +}; +typedef union C0CONR { + unsigned char c0con; + struct FIELD_C0CONR bc0con; +} C0CONR_T; +typedef union C1CONR { + unsigned char c1con; + struct FIELD_C1CONR bc1con; +} C1CONR_T; + +#define SJA_TSEG1 ((pParams->btr1 & 0x0f)+1) +#define SJA_TSEG2 (((pParams->btr1 & 0x70)>>4)+1) +#define SJA_BRP ((pParams->btr0 & 0x3f)+1) +#define SJA_SJW ((pParams->btr0 & 0xc0)>>6) +#define SJA_SAM ((pParams->btr1 & 0x80)>>7) +int baudrate_m16c(int clk, int brp, int pr, int ph1, int ph2); +int samplepoint_m16c(int brp, int pr, int ph1, int ph2); +int SJA1000_TO_M16C_BASIC_Params(CPC_MSG_T *pMsg); + +#endif |