-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathcp210x-new-id.sh
More file actions
executable file
·36 lines (27 loc) · 1.41 KB
/
Copy pathcp210x-new-id.sh
File metadata and controls
executable file
·36 lines (27 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
#
# This file is part of SerialPundit.
#
# Copyright (C) 2014-2021, Rishi Gupta. All rights reserved.
#
# The SerialPundit is DUAL LICENSED. It is made available under the terms of the GNU Affero
# General Public License (AGPL) v3.0 for non-commercial use and under the terms of a commercial
# license for commercial use of this software.
#
# The SerialPundit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#################################################################################################
# Run this script as root user. Replace VID and PID with USB-IF VID and PID of your device. For example
# if VID is 0x0403 then VID=0403 should be used. The XXXX and YYYY are in hexadecimal format.
# Assume we changed the VID/PID of CP210X device. Now the Linux kernel driver has to be compiled with support
# for these VID/PID combinations added. But on a running kernel this might not be possible in addition to
# other scenarios. We can dynamically make existing driver serve this device by associating VID/PID with
# the driver with the help of new_id sysfs file.
# Also this is not limited to cp210x devices but can be used with any usb-serial driver.
VID=XXXX
PID=YYYY
set -e
modprobe usbserial
modprobe cp210x
echo $VID $PID > /sys/bus/usb-serial/drivers/cp210x/new_id
echo "Done !"