1 // SPDX-License-Identifier: GPL-2.0
3 * Basic framing protocol for STM devices.
4 * Copyright (c) 2018, Intel Corporation.
7 #include <linux/module.h>
8 #include <linux/device.h>
12 static ssize_t
basic_write(struct stm_data
*data
, struct stm_output
*output
,
13 unsigned int chan
, const char *buf
, size_t count
)
15 unsigned int c
= output
->channel
+ chan
;
16 unsigned int m
= output
->master
;
17 const unsigned char nil
= 0;
20 sz
= stm_data_write(data
, m
, c
, true, buf
, count
);
22 data
->packet(data
, m
, c
, STP_PACKET_FLAG
, 0, 0, &nil
);
27 static const struct stm_protocol_driver basic_pdrv
= {
33 static int basic_stm_init(void)
35 return stm_register_protocol(&basic_pdrv
);
38 static void basic_stm_exit(void)
40 stm_unregister_protocol(&basic_pdrv
);
43 module_init(basic_stm_init
);
44 module_exit(basic_stm_exit
);
46 MODULE_LICENSE("GPL v2");
47 MODULE_DESCRIPTION("Basic STM framing protocol driver");
48 MODULE_AUTHOR("Alexander Shishkin <alexander.shishkin@linux.intel.com>");