blob: e556b0caff7191245c6627ba36240713fca550b8 [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
Andrew F. Davisde0d6db2017-06-05 08:52:08 -050030#include <linux/w1.h>
31
32#define W1_FAMILY_SMEM_01 0x01
33#define W1_FAMILY_SMEM_81 0x81
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Evgeniy Polyakov85e941c2005-05-02 14:26:42 +040035static struct w1_family w1_smem_family_01 = {
36 .fid = W1_FAMILY_SMEM_01,
Evgeniy Polyakov85e941c2005-05-02 14:26:42 +040037};
38
39static struct w1_family w1_smem_family_81 = {
40 .fid = W1_FAMILY_SMEM_81,
Linus Torvalds1da177e2005-04-16 15:20:36 -070041};
42
43static int __init w1_smem_init(void)
44{
Evgeniy Polyakov85e941c2005-05-02 14:26:42 +040045 int err;
46
47 err = w1_register_family(&w1_smem_family_01);
48 if (err)
49 return err;
Evgeniy Polyakovbd529cf2005-12-06 13:38:28 +030050
Evgeniy Polyakov85e941c2005-05-02 14:26:42 +040051 err = w1_register_family(&w1_smem_family_81);
52 if (err) {
53 w1_unregister_family(&w1_smem_family_01);
54 return err;
55 }
56
57 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070058}
59
60static void __exit w1_smem_fini(void)
61{
Evgeniy Polyakov85e941c2005-05-02 14:26:42 +040062 w1_unregister_family(&w1_smem_family_01);
63 w1_unregister_family(&w1_smem_family_81);
Linus Torvalds1da177e2005-04-16 15:20:36 -070064}
65
66module_init(w1_smem_init);
67module_exit(w1_smem_fini);
Andrew F. Davis50fa2952017-05-16 15:02:12 -050068
69MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");
70MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, 64bit memory family.");
71MODULE_LICENSE("GPL");
72MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_SMEM_01));
73MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_SMEM_81));