-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow refresh serdes configs during runtime
Add 2 attrs to refresh max9295/max9296 configs anytime by user. Signed-off-by: Xin Zhang <xin.x.zhang@intel.com>
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
kernel/nvidia/0057-Allow-refresh-serdes-configs-during-runtime.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
From 10dca4e22511f5490c824324a45ecc7dc95c99e4 Mon Sep 17 00:00:00 2001 | ||
From: Xin Zhang <xin.x.zhang@intel.com> | ||
Date: Tue, 17 May 2022 19:34:15 +0800 | ||
Subject: [PATCH] Allow refresh serdes configs during runtime | ||
|
||
Add 2 attrs to refresh max9295/max9296 configs anytime by user. | ||
|
||
Signed-off-by: Xin Zhang <xin.x.zhang@intel.com> | ||
--- | ||
drivers/media/i2c/max9295.c | 15 +++++++++++++++ | ||
drivers/media/i2c/max9296.c | 15 +++++++++++++++ | ||
2 files changed, 30 insertions(+) | ||
|
||
diff --git a/drivers/media/i2c/max9295.c b/drivers/media/i2c/max9295.c | ||
index 1ddb0d3e6..f8e938630 100644 | ||
--- a/drivers/media/i2c/max9295.c | ||
+++ b/drivers/media/i2c/max9295.c | ||
@@ -837,8 +837,23 @@ static ssize_t max9295_dev_dump_show(struct device *dev, | ||
|
||
static DEVICE_ATTR(register_dump, 0444, max9295_dev_dump_show, NULL); | ||
|
||
+static ssize_t refresh_setting_store(struct device *dev, | ||
+ struct device_attribute *attr, | ||
+ const char *buf, size_t count) | ||
+{ | ||
+ int ret; | ||
+ | ||
+ ret = max9295_init_settings(dev); | ||
+ if (ret) | ||
+ return ret; | ||
+ | ||
+ return count; | ||
+} | ||
+static DEVICE_ATTR_WO(refresh_setting); | ||
+ | ||
static struct attribute *max9295_attributes[] = { | ||
&dev_attr_register_dump.attr, | ||
+ &dev_attr_refresh_setting.attr, | ||
NULL | ||
}; | ||
|
||
diff --git a/drivers/media/i2c/max9296.c b/drivers/media/i2c/max9296.c | ||
index adc26c732..b73dfe82a 100644 | ||
--- a/drivers/media/i2c/max9296.c | ||
+++ b/drivers/media/i2c/max9296.c | ||
@@ -1162,8 +1162,23 @@ static ssize_t max9296_dev_dump_show(struct device *dev, | ||
|
||
static DEVICE_ATTR(register_dump, 0444, max9296_dev_dump_show, NULL); | ||
|
||
+static ssize_t refresh_setting_store(struct device *dev, | ||
+ struct device_attribute *attr, | ||
+ const char *buf, size_t count) | ||
+{ | ||
+ int ret; | ||
+ | ||
+ ret = max9296_init_settings(dev); | ||
+ if (ret) | ||
+ return ret; | ||
+ | ||
+ return count; | ||
+} | ||
+static DEVICE_ATTR_WO(refresh_setting); | ||
+ | ||
static struct attribute *max9296_attributes[] = { | ||
&dev_attr_register_dump.attr, | ||
+ &dev_attr_refresh_setting.attr, | ||
NULL | ||
}; | ||
|
||
-- | ||
2.17.1 | ||
|