Linux Audio

Check our new training course

Loading...
v5.4
 1// SPDX-License-Identifier: GPL-2.0-or-later
 2/*
 3 *	DEC platform devices.
 4 *
 5 *	Copyright (c) 2014  Maciej W. Rozycki
 
 
 
 
 
 6 */
 7
 8#include <linux/ioport.h>
 9#include <linux/kernel.h>
10#include <linux/mc146818rtc.h>
11#include <linux/platform_device.h>
12
13static struct resource dec_rtc_resources[] = {
14	{
15		.name = "rtc",
16		.flags = IORESOURCE_MEM,
17	},
18};
19
20static struct cmos_rtc_board_info dec_rtc_info = {
21	.flags = CMOS_RTC_FLAGS_NOFREQ,
22	.address_space = 64,
23};
24
25static struct platform_device dec_rtc_device = {
26	.name = "rtc_cmos",
27	.id = PLATFORM_DEVID_NONE,
28	.dev.platform_data = &dec_rtc_info,
29	.resource = dec_rtc_resources,
30	.num_resources = ARRAY_SIZE(dec_rtc_resources),
31};
32
33static int __init dec_add_devices(void)
34{
35	dec_rtc_resources[0].start = RTC_PORT(0);
36	dec_rtc_resources[0].end = RTC_PORT(0) + dec_kn_slot_size - 1;
37	return platform_device_register(&dec_rtc_device);
38}
39
40device_initcall(dec_add_devices);
v4.17
 
 1/*
 2 *	DEC platform devices.
 3 *
 4 *	Copyright (c) 2014  Maciej W. Rozycki
 5 *
 6 *	This program is free software; you can redistribute it and/or
 7 *	modify it under the terms of the GNU General Public License
 8 *	as published by the Free Software Foundation; either version
 9 *	2 of the License, or (at your option) any later version.
10 */
11
12#include <linux/ioport.h>
13#include <linux/kernel.h>
14#include <linux/mc146818rtc.h>
15#include <linux/platform_device.h>
16
17static struct resource dec_rtc_resources[] = {
18	{
19		.name = "rtc",
20		.flags = IORESOURCE_MEM,
21	},
22};
23
24static struct cmos_rtc_board_info dec_rtc_info = {
25	.flags = CMOS_RTC_FLAGS_NOFREQ,
26	.address_space = 64,
27};
28
29static struct platform_device dec_rtc_device = {
30	.name = "rtc_cmos",
31	.id = PLATFORM_DEVID_NONE,
32	.dev.platform_data = &dec_rtc_info,
33	.resource = dec_rtc_resources,
34	.num_resources = ARRAY_SIZE(dec_rtc_resources),
35};
36
37static int __init dec_add_devices(void)
38{
39	dec_rtc_resources[0].start = RTC_PORT(0);
40	dec_rtc_resources[0].end = RTC_PORT(0) + dec_kn_slot_size - 1;
41	return platform_device_register(&dec_rtc_device);
42}
43
44device_initcall(dec_add_devices);