diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2019-10-28 20:43:30 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2019-10-29 18:58:16 +0300 |
commit | 6f65bb40d3e8b7fe978698488c2ea93f077bfcd6 (patch) | |
tree | 41861c8b837d122abac15f18dbdf99cbd4835507 /meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0077-soc-aspeed-Add-read-only-property-support.patch | |
parent | da710c8bb0dea17982efc20ab4ee226a86992e6f (diff) | |
download | openbmc-6f65bb40d3e8b7fe978698488c2ea93f077bfcd6.tar.xz |
Update to internal 10-28-19
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0077-soc-aspeed-Add-read-only-property-support.patch')
-rw-r--r-- | meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0077-soc-aspeed-Add-read-only-property-support.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0077-soc-aspeed-Add-read-only-property-support.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0077-soc-aspeed-Add-read-only-property-support.patch new file mode 100644 index 000000000..7ea00a4a2 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0077-soc-aspeed-Add-read-only-property-support.patch @@ -0,0 +1,47 @@ +From f2d62c90f2ea05b1abf9a1887502122eefb5906d Mon Sep 17 00:00:00 2001 +From: Yong Li <yong.b.li@linux.intel.com> +Date: Wed, 16 Oct 2019 15:11:06 +0800 +Subject: [PATCH] soc: aspeed: Add read-only property support + +Add a read-only property, to support export register bits as read-only. + +Signed-off-by: Yong Li <yong.b.li@linux.intel.com> +--- + drivers/soc/aspeed/aspeed-bmc-misc.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/soc/aspeed/aspeed-bmc-misc.c b/drivers/soc/aspeed/aspeed-bmc-misc.c +index 314007b..bf88376 100644 +--- a/drivers/soc/aspeed/aspeed-bmc-misc.c ++++ b/drivers/soc/aspeed/aspeed-bmc-misc.c +@@ -15,6 +15,7 @@ struct aspeed_bmc_ctrl { + u32 offset; + u32 mask; + u32 shift; ++ bool read_only; + struct regmap *map; + struct kobj_attribute attr; + }; +@@ -55,6 +56,8 @@ static int aspeed_bmc_misc_parse_dt_child(struct device_node *child, + if (rc < 0) + return rc; + ++ ctrl->read_only = of_property_read_bool(child, "read-only"); ++ + ctrl->mask <<= ctrl->shift; + + return 0; +@@ -116,6 +119,10 @@ static ssize_t aspeed_bmc_misc_store(struct kobject *kobj, + return rc; + + ctrl = container_of(attr, struct aspeed_bmc_ctrl, attr); ++ ++ if (ctrl->read_only) ++ return -EROFS; ++ + val <<= ctrl->shift; + rc = regmap_update_bits(ctrl->map, ctrl->offset, ctrl->mask, val); + +-- +2.7.4 + |