/*struct rtc_unipi_platform_data *pdata = dev_get_platdata(&client->dev);*/
struct rtc_time tm;
unsigned long timestamp;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)
+ struct nvmem_config nvmem_cfg = {
+ .name = "rtc_unipi_nvram",
+ .word_size = 1,
+ .stride = 1,
+ .size = MCP794XX_NVRAM_SIZE,
+ .reg_read = rtc_unipi_nvram_read,
+ .reg_write = rtc_unipi_nvram_write,
+ .priv = rtc_unipi,
+ };
+#endif
rtc_unipi = devm_kzalloc(&client->dev, sizeof(struct rtc_unipi), GFP_KERNEL);
if (!rtc_unipi)
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0)
- /*if (chip->nvram_size) {*/
rtc_unipi->nvmem_cfg.name = "rtc_unipi_nvram";
rtc_unipi->nvmem_cfg.word_size = 1;
rtc_unipi->nvmem_cfg.stride = 1;
rtc_unipi->rtc->nvmem_config = &rtc_unipi->nvmem_cfg;
rtc_unipi->rtc->nvram_old_abi = true;
- /*}*/
#else
- struct nvmem_config nvmem_cfg = {
- .name = "rtc_unipi_nvram",
- .word_size = 1,
- .stride = 1,
- .size = MCP794XX_NVRAM_SIZE,
- .reg_read = rtc_unipi_nvram_read,
- .reg_write = rtc_unipi_nvram_write,
- .priv = rtc_unipi,
- };
-
rtc_unipi->rtc->nvram_old_abi = true;
rtc_nvmem_register(rtc_unipi->rtc, &nvmem_cfg);
static u8 neuronspi_probe_count = 0;
static struct spinlock *neuronspi_probe_spinlock;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0)
static struct sched_param neuronspi_sched_param = { .sched_priority = MAX_RT_PRIO / 2 };
+#endif
struct neuronspi_char_driver neuronspi_cdrv =
{
u32 probe_always_succeeds = 0;
u32 always_create_uart = 0;
struct kthread_worker *worker;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0)
struct sched_param rt_param = { .sched_priority = MAX_RT_PRIO - 1 };
+#endif
unsigned long flags;