提交 85e941cc 编写于 作者: E Evgeniy Polyakov 提交者: Greg Kroah-Hartman

[PATCH] w1_smem: support for new simple rom family [0x81 id].

Support for new simple rom family [0x81 id].
It is the same as existing 0x01 family,
which is used in ds9490* w1 adapters.
Patch is on top of new-thermal-sensor-families patch.
Signed-off-by: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 718a538f
......@@ -27,7 +27,8 @@
#include <asm/atomic.h>
#define W1_FAMILY_DEFAULT 0
#define W1_FAMILY_SMEM 0x01
#define W1_FAMILY_SMEM_01 0x01
#define W1_FAMILY_SMEM_81 0x81
#define W1_THERM_DS18S20 0x10
#define W1_THERM_DS1822 0x22
#define W1_THERM_DS18B20 0x28
......
......@@ -99,19 +99,37 @@ static ssize_t w1_smem_read_bin(struct kobject *kobj, char *buf, loff_t off, siz
return count;
}
static struct w1_family w1_smem_family = {
.fid = W1_FAMILY_SMEM,
static struct w1_family w1_smem_family_01 = {
.fid = W1_FAMILY_SMEM_01,
.fops = &w1_smem_fops,
};
static struct w1_family w1_smem_family_81 = {
.fid = W1_FAMILY_SMEM_81,
.fops = &w1_smem_fops,
};
static int __init w1_smem_init(void)
{
return w1_register_family(&w1_smem_family);
int err;
err = w1_register_family(&w1_smem_family_01);
if (err)
return err;
err = w1_register_family(&w1_smem_family_81);
if (err) {
w1_unregister_family(&w1_smem_family_01);
return err;
}
return 0;
}
static void __exit w1_smem_fini(void)
{
w1_unregister_family(&w1_smem_family);
w1_unregister_family(&w1_smem_family_01);
w1_unregister_family(&w1_smem_family_81);
}
module_init(w1_smem_init);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册