sharp-drm-driver-radxa-zero/main.c

65 lines
1.2 KiB
C
Raw Normal View History

2023-06-09 13:20:56 -04:00
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* DRM driver for 2.7" Sharp Memory LCD
*
* Copyright 2023 Andrew D'Angelo
*/
2018-05-17 12:45:14 -04:00
2023-06-09 13:20:56 -04:00
#include <linux/module.h>
#include <linux/spi/spi.h>
2018-05-17 12:45:14 -04:00
2023-06-28 23:33:41 -04:00
#include "drm_iface.h"
#include "params_iface.h"
2023-06-28 23:33:41 -04:00
#include "ioctl_iface.h"
2018-05-17 12:45:14 -04:00
2023-06-09 13:20:56 -04:00
static int sharp_memory_probe(struct spi_device *spi)
{
int ret;
2023-06-09 14:44:21 -04:00
printk(KERN_INFO "sharp_memory: entering sharp_memory_probe\n");
2023-06-28 23:33:41 -04:00
if ((ret = drm_probe(spi))) {
2023-06-09 13:20:56 -04:00
return ret;
}
2023-06-28 23:33:41 -04:00
if ((ret = params_probe())) {
2023-06-09 13:20:56 -04:00
return ret;
}
2023-06-28 23:33:41 -04:00
if ((ret = ioctl_probe())) {
2023-06-09 13:20:56 -04:00
return ret;
}
printk(KERN_INFO "sharp_memory: successful probe\n");
return 0;
}
2018-05-17 12:45:14 -04:00
2023-06-09 13:20:56 -04:00
static void sharp_memory_remove(struct spi_device *spi)
{
2023-06-28 23:33:41 -04:00
ioctl_remove();
params_remove();
drm_remove(spi);
2018-05-17 12:45:14 -04:00
}
2023-06-09 13:20:56 -04:00
static void sharp_memory_shutdown(struct spi_device *spi)
2018-05-17 12:45:14 -04:00
{
2023-06-28 23:33:41 -04:00
ioctl_shutdown();
params_shutdown();
drm_shutdown(spi);
2018-05-17 12:45:14 -04:00
}
2023-06-09 13:20:56 -04:00
static struct spi_driver sharp_memory_spi_driver = {
2018-05-17 12:45:14 -04:00
.driver = {
2023-06-09 13:20:56 -04:00
.name = "sharp",
2018-05-17 12:45:14 -04:00
},
2023-06-09 13:20:56 -04:00
.probe = sharp_memory_probe,
.remove = sharp_memory_remove,
.shutdown = sharp_memory_shutdown,
2018-05-17 12:45:14 -04:00
};
2023-06-09 13:20:56 -04:00
module_spi_driver(sharp_memory_spi_driver);
2018-05-17 12:45:14 -04:00
2023-06-09 13:20:56 -04:00
MODULE_DESCRIPTION("Sharp Memory LCD DRM driver");
MODULE_AUTHOR("Andrew D'Angelo");
MODULE_LICENSE("GPL");