Skip to content

Commit 244af73

Browse files
committed
V1.17
1 parent c79fbc4 commit 244af73

File tree

4 files changed

+31
-22
lines changed

4 files changed

+31
-22
lines changed

OrangePiRDA/kernel/arch/arm/mach-rda/devices.c

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -278,21 +278,19 @@ static struct platform_device rda_comreg0 = {
278278
.num_resources = ARRAY_SIZE(rda_comreg0_resource),
279279
};
280280

281-
static struct spi_gpio_platform_data spi_gpio_data = {
282-
.sck = 2, // spi pins on the comb
283-
.mosi = 4,
284-
.miso = 3,
281+
static struct spi_gpio_platform_data spi2_gpio_data = {
282+
.sck = 2, // spi pins on the comb
283+
.mosi = 3,
284+
.miso = 4,
285285

286-
.num_chipselect = 1, // this is the number of devices (we will only connect the screen, but can be extended for spidev)
286+
.num_chipselect = 2, // this is the number of devices (we will only connect the screen, but can be extended for spidev)
287287
};
288-
289-
struct platform_device rda_spi_gpio = {
290-
.name = "spi_gpio", // spi driver name
291-
.id = 3, // bus number, because spi0 spi1 spi2 is already described in this file, then this one will be 3
292-
.dev = {
293-
.platform_data = &spi_gpio_data,
294-
}};
295-
288+
struct platform_device rda_spi2_gpio = {
289+
.name = "spi_gpio", // spi driver name
290+
.id = 2, // bus number spi2 available on GPIO header
291+
.dev = {
292+
.platform_data = &spi2_gpio_data,
293+
}};
296294
static struct resource rda_md_resource[] = {
297295
[0] = {
298296
.start = RDA_COMREGS_PHYS,
@@ -1580,14 +1578,25 @@ static struct spi_board_info rda_spi_board_info[] = {
15801578
.bus_num = 0,
15811579
.chip_select = 1,
15821580
.controller_data = (void *)&tlv320aic23_spi,
1581+
.platform_data = (void *) NULL,
15831582
},
15841583
{
15851584
.modalias = "spidev", // driver name
1586-
.max_speed_hz = 32000000,
1585+
.max_speed_hz = 1000000,
15871586
.mode = SPI_MODE_0,
1588-
.bus_num = 3, // our spi number is 3
1587+
.bus_num = 2, // /dev/spidev2.0 using gpio_spi driver
15891588
.chip_select = 0,
1590-
.controller_data = (void *) 5, // CS pin
1589+
.controller_data = (void *) 10, // SPI2_CS_0 is not available on gpio HEADER, use any other GPIO CS pin
1590+
.platform_data = (void *) &spi2_gpio_data,
1591+
},
1592+
{
1593+
.modalias = "spidev", // driver name
1594+
.max_speed_hz = 1000000,
1595+
.mode = SPI_MODE_0,
1596+
.bus_num = 2, // /dev/spidev2.1 using gpio_spi driver
1597+
.chip_select = 1,
1598+
.controller_data = (void *) 6, // CS pin
1599+
.platform_data = (void *) &spi2_gpio_data,
15911600
},
15921601
};
15931602

@@ -1657,8 +1666,7 @@ static struct platform_device *devices[] __initdata = {
16571666
#endif
16581667
&rda_spi0,
16591668
&rda_spi1,
1660-
&rda_spi2,
1661-
&rda_spi_gpio,
1669+
&rda_spi2_gpio,
16621670
&rda_vibrator,
16631671
&rda_power_supply,
16641672
#ifdef CONFIG_LEDS_RDA
@@ -1703,4 +1711,4 @@ void __init rda_init_devices(void)
17031711
bl_device_init();
17041712
#endif
17051713
platform_add_devices(devices, ARRAY_SIZE(devices));
1706-
}
1714+
}

OrangePiRDA/scripts/lib/build_image.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build_rk_image() {
55
}
66

77
build_rda_image() {
8-
VER="v1.16"
8+
VER="v1.17"
99
IMAGENAME="Legendary_OrangePi_${BOARD}_${OS}_${DISTRO}_${IMAGETYPE}_${VER}"
1010
IMAGE="${BUILD}/images/$IMAGENAME.img"
1111

OrangePiRDA/scripts/lib/distributions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ EOF
604604
rm -f "$DEST/type-phase"
605605

606606
# GPIO fixup
607-
curl -k -L -o "$DEST/usr/local/sbin/gpio_fixup.sh" https://wiki.pbeirne.com/patb/i96/raw/master/gpio_fixup.sh
607+
curl -k -L -o "$DEST/usr/local/sbin/gpio_fixup.sh" https://raw.githubusercontent.com/MehdiZAABAR/OrangePi-I96-Work/master/OrangePiRDA/output/rootfs/usr/local/sbin/gpio_fixup.sh
608608
chmod +x "$DEST/usr/local/sbin/gpio_fixup.sh"
609609
curl -k -L -o "$DEST/usr/local/bin/opio" https://wiki.pbeirne.com/patb/opio/raw/master/opio
610610
chmod +x "$DEST/usr/local/bin/opio"

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Ubuntu is not building correctly yet.<br>
5050
<br>
5151
<h2>Version History</h2>
5252
<ol>
53+
<li>September 20th 2022 - V1.17 - Add further spidev fixes (thanks MZA, <a href="https://github.com/MehdiZAABAR/OrangePi-I96-Work/">OrangePi-I96-Work</a>)</li>
5354
<li>September 19th 2022 - V1.16 - Add cpufrequtils package (thanks Marco, <a href="https://github.com/TheRemote/Legendary-OrangePi-i96/pull/5">PR #5</a>)</li>
5455
<li>September 18th 2022 - V1.15 - Fix Bluetooth to have fixed MAC address stored in /data/misc/bluetooth (thanks Marco, <a href="https://github.com/TheRemote/Legendary-OrangePi-i96/pull/4">PR #4</a>)</li>
5556
<li>September 16th 2022 - V1.14 - Add bluez-tools package</li>
@@ -83,5 +84,5 @@ Is it enough? You'll have to judge for yourself if it's enough but it is enough
8384
<a href="https://4pda.to/forum/index.php?showtopic=813602&st=280">Credit to Yoshie</a> for enough hints to enable the spidev interface<br>
8485
<a href="https://github.com/TheRemote/Legendary-OrangePi-i96/pull/1">Credit to jakeau</a> for adding the ability to use the i96 as a HID device (PR #1)<br>
8586
<a href="https://github.com/TheRemote/Legendary-OrangePi-i96/pull/2">Credit to SteveGotthardt</a> for adding the USB serial connection and fixing ACL entries to eliminate warnings (PR #2)<br>
86-
<a href="https://github.com/MehdiZAABAR/WiringPi">Credit to MZA</a> for fixing the WiringPi library to work with the i96<br>
87+
<a href="https://github.com/MehdiZAABAR/WiringPi">Credit to MZA</a> for fixing the WiringPi library to work with the i96 as well as fixes to the spidev interface<br>
8788
<a href="https://github.com/well0nez/RDA5991g_patchram">Credit to Marco</a> for fixing the Bluetooth patchram utility to work with the i96 as well as fixing the Bluetooth MAC address (PR #4)<br>

0 commit comments

Comments
 (0)