linux_dsm_epyc7002/include/linux/soc/qcom/smd.h
Bjorn Andersson f79a917e69 Qualcomm ARM Based SoC Updates for v4.7 part 2
* Change SMD callback parameters
 * Use writecombine mapping for SMEM
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXFvdZAAoJEFKiBbHx2RXVxPQQAJnEp1+5CDN7ziQ/zJ3juSxb
 b7rOr5Z0qMDhh0H9BFdmhGzFctbY0AOqerfh138pXa6KN7maXT/enUE4vvtWUp1B
 HCr9xt13waoa8e6umj/D1qU5mMLUX+JraVkIo6Dyd1g6pVmdrbwzP+Z0tW0x7CvW
 n5r9eDYts66vGbQ6xzK40rTi22sEN32AY4mezKj40L8o0NvfZCCwb3dfw2RQzLHK
 0KnSQ0PKqU1ZWrDc2YuvRsyh5KGv+t8vvnpMVVUi4TRx3qzoGpHpH3fE3evvMGKY
 ya6nmFNFPZ+ZlzsGDx10RqLu58NmjS8LXY6O+yCGy9NPuonKpwHgYD2wxut2NR/W
 TTtMhvJWKNIwhXR8ZRDaVBWQJBwoLvpNQT1zOIUuUKf+SZ2DbfgVpte7NZvrgEka
 aY4nnZMbI0MvpaAHUtllWbC4xqMQJXY+4wrahKQgKF/l5H/0XQ99fHHz86DS9LCO
 y+dfmU98dv/1X8qmxNfsULtJwbxi2Xwzt3MMMZb5v138STyMWeqWOLm+KGzgs1hu
 Pc/RLQALdJpQEcg74s5xt2yxSqRuzDig7FtRT1a2SX33vi9YohQEgXCDe+IOJC5l
 sm1Ppi3oO/yUcocUDFTBz/g6zD4SWywu2gmBcZIh/JVy8Sd053WwlaKs1Nld6ta7
 QPx6rga7lgrYW409RS2A
 =Jzqj
 -----END PGP SIGNATURE-----

Merge tag 'qcom-soc-for-4.7-2' into net-next

This merges the Qualcomm SOC tree with the net-next, solving the
merge conflict in the SMD API between the two.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-05-13 14:42:23 -07:00

115 lines
2.7 KiB
C

#ifndef __QCOM_SMD_H__
#define __QCOM_SMD_H__
#include <linux/device.h>
#include <linux/mod_devicetable.h>
struct qcom_smd;
struct qcom_smd_channel;
struct qcom_smd_lookup;
/**
* struct qcom_smd_id - struct used for matching a smd device
* @name: name of the channel
*/
struct qcom_smd_id {
char name[20];
};
/**
* struct qcom_smd_device - smd device struct
* @dev: the device struct
* @channel: handle to the smd channel for this device
*/
struct qcom_smd_device {
struct device dev;
struct qcom_smd_channel *channel;
};
typedef int (*qcom_smd_cb_t)(struct qcom_smd_channel *, const void *, size_t);
/**
* struct qcom_smd_driver - smd driver struct
* @driver: underlying device driver
* @smd_match_table: static channel match table
* @probe: invoked when the smd channel is found
* @remove: invoked when the smd channel is closed
* @callback: invoked when an inbound message is received on the channel,
* should return 0 on success or -EBUSY if the data cannot be
* consumed at this time
*/
struct qcom_smd_driver {
struct device_driver driver;
const struct qcom_smd_id *smd_match_table;
int (*probe)(struct qcom_smd_device *dev);
void (*remove)(struct qcom_smd_device *dev);
qcom_smd_cb_t callback;
};
#if IS_ENABLED(CONFIG_QCOM_SMD)
int qcom_smd_driver_register(struct qcom_smd_driver *drv);
void qcom_smd_driver_unregister(struct qcom_smd_driver *drv);
struct qcom_smd_channel *qcom_smd_open_channel(struct qcom_smd_channel *channel,
const char *name,
qcom_smd_cb_t cb);
void *qcom_smd_get_drvdata(struct qcom_smd_channel *channel);
void qcom_smd_set_drvdata(struct qcom_smd_channel *channel, void *data);
int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len);
#else
static inline int qcom_smd_driver_register(struct qcom_smd_driver *drv)
{
return -ENXIO;
}
static inline void qcom_smd_driver_unregister(struct qcom_smd_driver *drv)
{
/* This shouldn't be possible */
WARN_ON(1);
}
static inline struct qcom_smd_channel *
qcom_smd_open_channel(struct qcom_smd_channel *channel,
const char *name,
qcom_smd_cb_t cb)
{
/* This shouldn't be possible */
WARN_ON(1);
return NULL;
}
void *qcom_smd_get_drvdata(struct qcom_smd_channel *channel)
{
/* This shouldn't be possible */
WARN_ON(1);
return NULL;
}
void qcom_smd_set_drvdata(struct qcom_smd_channel *channel, void *data)
{
/* This shouldn't be possible */
WARN_ON(1);
}
static inline int qcom_smd_send(struct qcom_smd_channel *channel,
const void *data, int len)
{
/* This shouldn't be possible */
WARN_ON(1);
return -ENXIO;
}
#endif
#define module_qcom_smd_driver(__smd_driver) \
module_driver(__smd_driver, qcom_smd_driver_register, \
qcom_smd_driver_unregister)
#endif