2 * Header file for the Linux CAN-bus driver - LinCAN.
3 * Written by Arnaud Westenberg email:arnaud@wanadoo.nl
4 * Rewritten for new CAN queues by Pavel Pisa - OCERA team member
5 * email:pisa@cmp.felk.cvut.cz
6 * Adapted for spican by Jan Kriz
7 * email:devel@jojen.net
8 * This software is released under the GPL-License.
9 * Version lincan-0.3.4-r1 20 Aug 2010
12 #define OMAP2_SPICAN_NCHIPS 1 // Since the device is initiated from SPI, it's applies to 1 chip (and 1 irq) at a time
14 int spican_request_io(struct candevice_t *candev);
15 int spican_release_io(struct candevice_t *candev);
16 int spican_reset(struct candevice_t *candev);
17 int spican_init_hw_data(struct candevice_t *candev);
18 int spican_init_chip_data(struct candevice_t *candev, int chipnr);
19 int spican_init_obj_data(struct canchip_t *chip, int objnr);
20 void spican_write_register(unsigned data, can_ioptr_t address);
21 unsigned spican_read_register(can_ioptr_t address);
22 int spican_program_irq(struct candevice_t *candev);
24 #define OMAP2_SPICAN_TRIG_IRQ (1<<0)
25 #define OMAP2_SPICAN_TRIG_GPT (1<<1)
26 #define OMAP2_SPICAN_TRIG_SYS (1<<2)
28 #define OMAP2_SPICAN_MCP_CLK (20000000)
29 #define OMAP2_SPICAN_BAUDRATE (1000000)
31 #define OMAP2_SPICAN_CS_CHANGE (1)
32 #define OMAP2_SPICAN_DELAY_USECS (0)
33 #define OMAP2_SPICAN_SPEED_HZ (10000000)
35 struct omap2_spican_platform_data {
36 uint32_t mcp2515_clk; /* Clock frequency of MCP2515 */
37 uint32_t baudrate; /* Requested can communication speed */
39 unsigned cs_change; /* Cycle ~CS between transmissions? */
40 u16 delay_usecs; /* Time gap between transmissions */
41 u32 speed_hz; /* Speed of SPI communication */
45 /* Following options are set at runtime */
46 struct spi_device *spi; /* SPI device */
49 #ifdef CONFIG_OMAP_DM_TIMER
50 struct omap_dm_timer *timer_ptr; // timer object
51 int32_t timer_irq; // the IRQ # for our gp timer
52 #endif /* CONFIG_OMAP_DM_TIMER */
56 int omap2_spican_init(void);
57 void omap2_spican_exit(void);