blob: ed4c87506defb19ff0e928f0a79df169bcc54ac9 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Evgeniy Polyakov77859252005-05-20 22:33:25 +04002 * w1_smem.c
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
Evgeniy Polyakova8018762011-08-25 15:59:06 -07004 * Copyright (c) 2004 Evgeniy Polyakov <zbr@ioremap.net>
Evgeniy Polyakov77859252005-05-20 22:33:25 +04005 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the smems of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#include <asm/types.h>
23
24#include <linux/kernel.h>
25#include <linux/module.h>
26#include <linux/moduleparam.h>
27#include <linux/device.h>
28#include <linux/types.h>
29
Evgeniy Polyakovbd529cf2005-12-06 13:38:28 +030030#include "../w1.h"
Evgeniy Polyakovbd529cf2005-12-06 13:38:28 +030031#include "../w1_int.h"
32#include "../w1_family.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070033
34MODULE_LICENSE("GPL");
Evgeniy Polyakova8018762011-08-25 15:59:06 -070035MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");
Linus Torvalds1da177e2005-04-16 15:20:36 -070036MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, 64bit memory family.");
Alexander Stein8d7bda52013-05-26 20:06:50 +020037MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_SMEM_01));
38MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_SMEM_81));
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
Evgeniy Polyakov85e941c2005-05-02 14:26:42 +040040static struct w1_family w1_smem_family_01 = {
41 .fid = W1_FAMILY_SMEM_01,
Evgeniy Polyakov85e941c2005-05-02 14:26:42 +040042};
43
44static struct w1_family w1_smem_family_81 = {
45 .fid = W1_FAMILY_SMEM_81,
Linus Torvalds1da177e2005-04-16 15:20:36 -070046};
47
48static int __init w1_smem_init(void)
49{
Evgeniy Polyakov85e941c2005-05-02 14:26:42 +040050 int err;
51
52 err = w1_register_family(&w1_smem_family_01);
53 if (err)
54 return err;
Evgeniy Polyakovbd529cf2005-12-06 13:38:28 +030055
Evgeniy Polyakov85e941c2005-05-02 14:26:42 +040056 err = w1_register_family(&w1_smem_family_81);
57 if (err) {
58 w1_unregister_family(&w1_smem_family_01);
59 return err;
60 }
61
62 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063}
64
65static void __exit w1_smem_fini(void)
66{
Evgeniy Polyakov85e941c2005-05-02 14:26:42 +040067 w1_unregister_family(&w1_smem_family_01);
68 w1_unregister_family(&w1_smem_family_81);
Linus Torvalds1da177e2005-04-16 15:20:36 -070069}
70
71module_init(w1_smem_init);
72module_exit(w1_smem_fini);