i2c: allow attaching IRQ resources to i2c_board_info

Simple integer for interrupt number is not expressive enough, as it does
not convey interrupt trigger type that should be used. Let's allow
attaching array of resources to the board info and have i2c core parse
first IRQ resource and set up interrupt trigger as needed.

Reviewed-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Dmitry Torokhov
2017-03-01 11:45:51 -08:00
父節點 0daaf99d84
當前提交 4124c4eba4
共有 3 個文件被更改,包括 46 次插入0 次删除

查看文件

@@ -90,6 +90,18 @@ int i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsig
}
}
if (info->resources) {
devinfo->board_info.resources =
kmemdup(info->resources,
info->num_resources *
sizeof(*info->resources),
GFP_KERNEL);
if (!devinfo->board_info.resources) {
status = -ENOMEM;
break;
}
}
list_add_tail(&devinfo->list, &__i2c_board_list);
}