| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
| Evgeniy Polyakov | 7785925 | 2005-05-20 22:33:25 +0400 | [diff] [blame] | 2 |  *	w1_smem.c | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 |  * | 
 | 4 |  * Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru> | 
| Evgeniy Polyakov | 7785925 | 2005-05-20 22:33:25 +0400 | [diff] [blame] | 5 |  * | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 |  * | 
 | 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 Polyakov | bd529cf | 2005-12-06 13:38:28 +0300 | [diff] [blame] | 30 | #include "../w1.h" | 
| Evgeniy Polyakov | bd529cf | 2005-12-06 13:38:28 +0300 | [diff] [blame] | 31 | #include "../w1_int.h" | 
 | 32 | #include "../w1_family.h" | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 |  | 
 | 34 | MODULE_LICENSE("GPL"); | 
 | 35 | MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>"); | 
 | 36 | MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, 64bit memory family."); | 
 | 37 |  | 
| Evgeniy Polyakov | 85e941c | 2005-05-02 14:26:42 +0400 | [diff] [blame] | 38 | static struct w1_family w1_smem_family_01 = { | 
 | 39 | 	.fid = W1_FAMILY_SMEM_01, | 
| Evgeniy Polyakov | 85e941c | 2005-05-02 14:26:42 +0400 | [diff] [blame] | 40 | }; | 
 | 41 |  | 
 | 42 | static struct w1_family w1_smem_family_81 = { | 
 | 43 | 	.fid = W1_FAMILY_SMEM_81, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | }; | 
 | 45 |  | 
 | 46 | static int __init w1_smem_init(void) | 
 | 47 | { | 
| Evgeniy Polyakov | 85e941c | 2005-05-02 14:26:42 +0400 | [diff] [blame] | 48 | 	int err; | 
 | 49 |  | 
 | 50 | 	err = w1_register_family(&w1_smem_family_01); | 
 | 51 | 	if (err) | 
 | 52 | 		return err; | 
| Evgeniy Polyakov | bd529cf | 2005-12-06 13:38:28 +0300 | [diff] [blame] | 53 |  | 
| Evgeniy Polyakov | 85e941c | 2005-05-02 14:26:42 +0400 | [diff] [blame] | 54 | 	err = w1_register_family(&w1_smem_family_81); | 
 | 55 | 	if (err) { | 
 | 56 | 		w1_unregister_family(&w1_smem_family_01); | 
 | 57 | 		return err; | 
 | 58 | 	} | 
 | 59 |  | 
 | 60 | 	return 0; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | } | 
 | 62 |  | 
 | 63 | static void __exit w1_smem_fini(void) | 
 | 64 | { | 
| Evgeniy Polyakov | 85e941c | 2005-05-02 14:26:42 +0400 | [diff] [blame] | 65 | 	w1_unregister_family(&w1_smem_family_01); | 
 | 66 | 	w1_unregister_family(&w1_smem_family_81); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | } | 
 | 68 |  | 
 | 69 | module_init(w1_smem_init); | 
 | 70 | module_exit(w1_smem_fini); |