It's used for transceiver_switch.
NOTE: it's newly added since it's deleted by upstream before.
However, the driver is still using it, so have to add it.
Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit
53109634188e672b807a7256afbf10db0d9a6574)
#include <linux/can/dev.h>
#include <linux/can/error.h>
#include <linux/can/led.h>
+#include <linux/can/platform/flexcan.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
static inline int flexcan_transceiver_enable(const struct flexcan_priv *priv)
{
+ if (priv->pdata && priv->pdata->transceiver_switch) {
+ priv->pdata->transceiver_switch(1);
+ return 0;
+ }
+
if (!priv->reg_xceiver)
return 0;
static inline int flexcan_transceiver_disable(const struct flexcan_priv *priv)
{
+ if (priv->pdata && priv->pdata->transceiver_switch) {
+ priv->pdata->transceiver_switch(0);
+ return 0;
+ }
+
if (!priv->reg_xceiver)
return 0;
--- /dev/null
+/*
+ * Copyright (C) 2014 Freescale Semiconductor, Inc.
+ *
+ * This file is released under the GPLv2
+ *
+ */
+
+#ifndef __CAN_PLATFORM_FLEXCAN_H
+#define __CAN_PLATFORM_FLEXCAN_H
+
+/**
+ * struct flexcan_platform_data - flex CAN controller platform data
+ * @transceiver_enable: - called to power on/off the transceiver
+ *
+ */
+struct flexcan_platform_data {
+ void (*transceiver_switch)(int enable);
+};
+
+#endif /* __CAN_PLATFORM_FLEXCAN_H */