-
Notifications
You must be signed in to change notification settings - Fork 30
Tracked on RSDSO-21191 Support Nvidia JP 5.1.x/RSDSO-21146 Support Nvidia JP6.2.2 #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
75d2645
add 6.2.2 and 5.1.6
Kontra2B 90ea792
fix metadata video unregister
Kontra2B 5e29fd1
apply code review remarks
Kontra2B 9b46c6c
Update scripts/setup-common
Kontra2B 6b0acd5
Update kernel/nvidia/5.1.6/0001-Porting-driver-patches-to-jetpack-5.1…
Kontra2B c15d795
Update setup_workspace.sh
Kontra2B 6d97909
Update kernel/nvidia/5.1.6/0001-Porting-driver-patches-to-jetpack-5.1…
Kontra2B 3440351
fix patch
Kontra2B 19f6742
version handling reworked
Kontra2B da27004
apply code review remarks
Kontra2B db46027
updated patch links
Kontra2B f35ec8b
updated patch links
Kontra2B 85287b5
apply code review remark
Kontra2B File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,25 @@ | ||
| name: Build JP 5.1.6 | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - dev | ||
| pull_request: | ||
| branches: ['**'] | ||
|
|
||
| permissions: read-all | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3 | ||
| - name: setup workspace | ||
| run: yes | ./setup_workspace.sh 5.1.6 | ||
| - name: apply patches | ||
| run: git config --global user.email "builder@example.com" && git config --global user.name "builder" && ./apply_patches.sh | ||
| - name: build | ||
| run: ./build_all.sh | ||
This file contains hidden or 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,25 @@ | ||
| name: Build JP 6.2.2 | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - dev | ||
| pull_request: | ||
| branches: ['**'] | ||
|
|
||
| permissions: read-all | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3 | ||
| - name: setup workspace | ||
| run: yes | ./setup_workspace.sh 6.2.2 | ||
|
Kontra2B marked this conversation as resolved.
|
||
| - name: apply patches | ||
| run: git config --global user.email "builder@example.com" && git config --global user.name "builder" && ./apply_patches.sh | ||
| - name: build | ||
| run: ./build_all.sh | ||
This file contains hidden or 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
This file contains hidden or 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 @@ | ||
| 5.1.2 |
1 change: 1 addition & 0 deletions
1
kernel/kernel-jammy-src/6.2.2/0001-kernel-enable-HID_SENSOR-without-USB-impact.patch
This file contains hidden or 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 @@ | ||
| ../6.2.1/0001-kernel-enable-HID_SENSOR-without-USB-impact.patch |
1 change: 1 addition & 0 deletions
1
kernel/kernel-jammy-src/6.2.2/0002-realsense-camera-formats-jammy-master.patch
This file contains hidden or 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 @@ | ||
| ../6.2.1/0002-realsense-camera-formats-jammy-master.patch |
1 change: 1 addition & 0 deletions
1
kernel/kernel-jammy-src/6.2.2/0003-realsense-metadata-jammy-master.patch
This file contains hidden or 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 @@ | ||
| ../6.2.1/0003-realsense-metadata-jammy-master.patch |
1 change: 1 addition & 0 deletions
1
kernel/kernel-jammy-src/6.2.2/0004-realsense-powerlinefrequency-control-fix-jammy.patch
This file contains hidden or 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 @@ | ||
| ../6.2.1/0004-realsense-powerlinefrequency-control-fix-jammy.patch |
173 changes: 173 additions & 0 deletions
173
kernel/kernel-jammy-src/6.2.2/0005-support-for-dynamic-change-of-i2c-bus-clk-rate.patch
This file contains hidden or 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,173 @@ | ||
| From ce6faaedef68204e8b132bf44a0e4d2432dfb7ad Mon Sep 17 00:00:00 2001 | ||
| From: Arun-Prasad-V <arun.prasad.v@intel.com> | ||
| Date: Mon, 4 Nov 2024 12:52:39 +0530 | ||
| Subject: [PATCH] Support for dynamic change of i2c bus-clk-rate | ||
|
|
||
| Signed-off-by: Arun Prasad V <arun.prasad.v@intel.com> | ||
| --- | ||
| drivers/i2c/busses/i2c-tegra.c | 42 +++++++++++++++++++++++++++++++ | ||
| drivers/i2c/i2c-core-base.c | 45 ++++++++++++++++++++++++++++++++++ | ||
| include/linux/i2c.h | 5 ++++ | ||
| 3 files changed, 92 insertions(+) | ||
|
|
||
| diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c | ||
| index cd50436e5734..4269343266c2 100644 | ||
| --- a/drivers/i2c/busses/i2c-tegra.c | ||
| +++ b/drivers/i2c/busses/i2c-tegra.c | ||
| @@ -1484,6 +1484,37 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, | ||
| return 0; | ||
| } | ||
|
|
||
| +static int tegra_i2c_change_clock_rate(struct tegra_i2c_dev *i2c_dev) | ||
| +{ | ||
| + u32 val; | ||
| + int err; | ||
| + | ||
| + val = I2C_CNFG_NEW_MASTER_FSM | I2C_CNFG_PACKET_MODE_EN | | ||
| + FIELD_PREP(I2C_CNFG_DEBOUNCE_CNT, 2); | ||
| + | ||
| + if (i2c_dev->hw->has_multi_master_mode) | ||
| + val |= I2C_CNFG_MULTI_MASTER_MODE; | ||
| + | ||
| + i2c_writel(i2c_dev, val, I2C_CNFG); | ||
| + | ||
| + if (i2c_dev->prod_list) | ||
| + tegra_i2c_config_prod_settings(i2c_dev); | ||
| + else | ||
| + tegra_i2c_set_clk_params(i2c_dev); | ||
| + | ||
| + err = tegra_i2c_set_div_clk(i2c_dev); | ||
| + if (err) { | ||
| + dev_err(i2c_dev->dev, "failed to set div-clk rate: %d\n", err); | ||
| + return err; | ||
| + } | ||
| + | ||
| + err = tegra_i2c_wait_for_config_load(i2c_dev); | ||
| + if (err) | ||
| + return err; | ||
| + | ||
| + return err; | ||
| +} | ||
| + | ||
| static int tegra_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], | ||
| int num) | ||
| { | ||
| @@ -1497,6 +1528,16 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], | ||
| return ret; | ||
| } | ||
|
|
||
| + if (adap->bus_clk_rate != i2c_dev->bus_clk_rate) { | ||
| + i2c_dev->bus_clk_rate = adap->bus_clk_rate; | ||
| + ret = tegra_i2c_change_clock_rate(i2c_dev); | ||
| + if (ret) { | ||
| + dev_err(i2c_dev->dev, | ||
| + "failed changing clock rate: %d\n", ret); | ||
| + return ret; | ||
| + } | ||
| + } | ||
| + | ||
| for (i = 0; i < num; i++) { | ||
| enum msg_end_type end_type = MSG_END_STOP; | ||
|
|
||
| @@ -1957,6 +1998,7 @@ static int tegra_i2c_probe(struct platform_device *pdev) | ||
| i2c_dev->adapter.class = I2C_CLASS_DEPRECATED; | ||
| i2c_dev->adapter.algo = &tegra_i2c_algo; | ||
| i2c_dev->adapter.nr = pdev->id; | ||
| + i2c_dev->adapter.bus_clk_rate = i2c_dev->bus_clk_rate; | ||
|
|
||
| if (i2c_dev->hw->supports_bus_clear) | ||
| i2c_dev->adapter.bus_recovery_info = &tegra_i2c_recovery_info; | ||
| diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c | ||
| index c232535ca8f4..2edd24973cca 100644 | ||
| --- a/drivers/i2c/i2c-core-base.c | ||
| +++ b/drivers/i2c/i2c-core-base.c | ||
| @@ -1285,10 +1285,33 @@ delete_device_store(struct device *dev, struct device_attribute *attr, | ||
| static DEVICE_ATTR_IGNORE_LOCKDEP(delete_device, S_IWUSR, NULL, | ||
| delete_device_store); | ||
|
|
||
| +static ssize_t show_bus_clk_rate(struct device *dev, | ||
| + struct device_attribute *attr, char *buf) | ||
| +{ | ||
| + struct i2c_adapter *adap = to_i2c_adapter(dev); | ||
| + | ||
| + return sprintf(buf, "%ld\n", adap->bus_clk_rate); | ||
| +} | ||
| + | ||
| +static ssize_t set_bus_clk_rate(struct device *dev, | ||
| + struct device_attribute *attr, const char *buf, size_t count) | ||
| +{ | ||
| + struct i2c_adapter *adap = to_i2c_adapter(dev); | ||
| + char *p = (char *)buf; | ||
| + int bus_clk_rate; | ||
| + | ||
| + bus_clk_rate = memparse(p, &p); | ||
| + dev_info(dev, "Setting clock rate %d on next transfer\n", bus_clk_rate); | ||
|
sareluzi marked this conversation as resolved.
|
||
| + adap->bus_clk_rate = bus_clk_rate; | ||
| + return count; | ||
| +} | ||
|
sareluzi marked this conversation as resolved.
|
||
| +static DEVICE_ATTR(bus_clk_rate, 0644, show_bus_clk_rate, set_bus_clk_rate); | ||
| + | ||
| static struct attribute *i2c_adapter_attrs[] = { | ||
| &dev_attr_name.attr, | ||
| &dev_attr_new_device.attr, | ||
| &dev_attr_delete_device.attr, | ||
| + &dev_attr_bus_clk_rate.attr, | ||
| NULL | ||
| }; | ||
| ATTRIBUTE_GROUPS(i2c_adapter); | ||
| @@ -1401,6 +1424,28 @@ static int i2c_setup_host_notify_irq_domain(struct i2c_adapter *adap) | ||
| return 0; | ||
| } | ||
|
|
||
| +int i2c_set_adapter_bus_clk_rate(struct i2c_adapter *adap, int bus_rate) | ||
| +{ | ||
| + i2c_lock_bus(adap, I2C_LOCK_ROOT_ADAPTER); | ||
| + adap->bus_clk_rate = bus_rate; | ||
| + i2c_unlock_bus(adap, I2C_LOCK_ROOT_ADAPTER); | ||
| + | ||
| + return 0; | ||
| +} | ||
| +EXPORT_SYMBOL_GPL(i2c_set_adapter_bus_clk_rate); | ||
| + | ||
| +int i2c_get_adapter_bus_clk_rate(struct i2c_adapter *adap) | ||
| +{ | ||
| + int bus_clk_rate; | ||
| + | ||
| + i2c_lock_bus(adap, I2C_LOCK_ROOT_ADAPTER); | ||
| + bus_clk_rate = adap->bus_clk_rate; | ||
| + i2c_unlock_bus(adap, I2C_LOCK_ROOT_ADAPTER); | ||
| + | ||
| + return bus_clk_rate; | ||
| +} | ||
| +EXPORT_SYMBOL_GPL(i2c_get_adapter_bus_clk_rate); | ||
| + | ||
| /** | ||
| * i2c_handle_smbus_host_notify - Forward a Host Notify event to the correct | ||
| * I2C client. | ||
| diff --git a/include/linux/i2c.h b/include/linux/i2c.h | ||
| index 2ce3efbe9198..9d876ad6373c 100644 | ||
| --- a/include/linux/i2c.h | ||
| +++ b/include/linux/i2c.h | ||
| @@ -131,6 +131,10 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num); | ||
| /* Unlocked flavor */ | ||
| int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num); | ||
|
|
||
| +/* Change bus clock rate for i2c adapter */ | ||
| +extern int i2c_set_adapter_bus_clk_rate(struct i2c_adapter *adap, int bus_rate); | ||
| +extern int i2c_get_adapter_bus_clk_rate(struct i2c_adapter *adap); | ||
| + | ||
| /* This is the very generalized SMBus access routine. You probably do not | ||
| want to use this, though; one of the functions below may be much easier, | ||
| and probably just as fast. | ||
| @@ -737,6 +741,7 @@ struct i2c_adapter { | ||
| const struct i2c_adapter_quirks *quirks; | ||
|
|
||
| struct irq_domain *host_notify_domain; | ||
| + unsigned long bus_clk_rate; | ||
| struct regulator *bus_regulator; | ||
|
|
||
| struct dentry *debugfs; | ||
| #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) | ||
| -- | ||
| 2.34.1 | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.