Commit e0000163 authored by Christian Pellegrin's avatar Christian Pellegrin Committed by David S. Miller
Browse files

can: Driver for the Microchip MCP251x SPI CAN controllers

parent 81adee47
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -102,6 +102,12 @@ config CAN_TI_HECC
	  Driver for TI HECC (High End CAN Controller) module found on many
	  Driver for TI HECC (High End CAN Controller) module found on many
	  TI devices. The device specifications are available from www.ti.com
	  TI devices. The device specifications are available from www.ti.com


config CAN_MCP251X
	tristate "Microchip MCP251x SPI CAN controllers"
	depends on CAN_DEV && SPI
	---help---
	  Driver for the Microchip MCP251x SPI CAN controllers.

config CAN_DEBUG_DEVICES
config CAN_DEBUG_DEVICES
	bool "CAN devices debugging messages"
	bool "CAN devices debugging messages"
	depends on CAN
	depends on CAN
+1 −0
Original line number Original line Diff line number Diff line
@@ -12,5 +12,6 @@ obj-y += usb/
obj-$(CONFIG_CAN_SJA1000)	+= sja1000/
obj-$(CONFIG_CAN_SJA1000)	+= sja1000/
obj-$(CONFIG_CAN_AT91)		+= at91_can.o
obj-$(CONFIG_CAN_AT91)		+= at91_can.o
obj-$(CONFIG_CAN_TI_HECC)	+= ti_hecc.o
obj-$(CONFIG_CAN_TI_HECC)	+= ti_hecc.o
obj-$(CONFIG_CAN_MCP251X)	+= mcp251x.o


ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
+1164 −0

File added.

Preview size limit exceeded, changes collapsed.

+36 −0
Original line number Original line Diff line number Diff line
#ifndef __CAN_PLATFORM_MCP251X_H__
#define __CAN_PLATFORM_MCP251X_H__

/*
 *
 * CAN bus driver for Microchip 251x CAN Controller with SPI Interface
 *
 */

#include <linux/spi/spi.h>

/**
 * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data
 * @oscillator_frequency:       - oscillator frequency in Hz
 * @model:                      - actual type of chip
 * @board_specific_setup:       - called before probing the chip (power,reset)
 * @transceiver_enable:         - called to power on/off the transceiver
 * @power_enable:               - called to power on/off the mcp *and* the
 *                                transceiver
 *
 * Please note that you should define power_enable or transceiver_enable or
 * none of them. Defining both of them is no use.
 *
 */

struct mcp251x_platform_data {
	unsigned long oscillator_frequency;
	int model;
#define CAN_MCP251X_MCP2510 0
#define CAN_MCP251X_MCP2515 1
	int (*board_specific_setup)(struct spi_device *spi);
	int (*transceiver_enable)(int enable);
	int (*power_enable) (int enable);
};

#endif /* __CAN_PLATFORM_MCP251X_H__ */