Skip to content

Commit bd4f46b

Browse files
committed
patch #10030: linuxspi: Support inverted GPIO pin
Submitted by Alex Sverdlin: * linuxspi.c (linuxspi_open): Clear the inversion mask on request and set default state to avoid short glitches on the GPIO line. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1494 81a1dc3b-b13d-400b-aceb-764788c761c2
1 parent 6f183d4 commit bd4f46b

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2021-11-27 Joerg Wunsch <[email protected]>
2+
3+
Submitted by Alex Sverdlin:
4+
patch #10030: linuxspi: Support inverted GPIO pin
5+
* linuxspi.c (linuxspi_open): Clear the inversion mask on request
6+
and set default state to avoid short glitches on the GPIO line.
7+
18
2021-11-27 Joerg Wunsch <[email protected]>
29

310
Submitted by Alex Sverdlin:

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Current:
120120
patch #10027: linuxspi: Add reset pulse, according to AVR programming algorithm
121121
patch #10028: linuxspi: close() only when necessary
122122
patch #10029: linuxspi: Report GPIO_GET_LINEHANDLE_IOCTL errors
123+
patch #10030: linuxspi: Support inverted GPIO pin
123124

124125
* Internals:
125126
- New avrdude.conf keyword "family_id", used to verify SIB attributes

linuxspi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ static int linuxspi_open(PROGRAMMER *pgm, char *port)
164164

165165
strcpy(req.consumer_label, progname);
166166
req.lines = 1;
167-
req.lineoffsets[0] = pgm->pinno[PIN_AVR_RESET];
167+
req.lineoffsets[0] = pgm->pinno[PIN_AVR_RESET] & ~PIN_INVERSE;
168+
req.default_values[0] = !!(pgm->pinno[PIN_AVR_RESET] & PIN_INVERSE);
168169
req.flags = GPIOHANDLE_REQUEST_OUTPUT;
169170

170171
ret = ioctl(fd_gpiochip, GPIO_GET_LINEHANDLE_IOCTL, &req);

0 commit comments

Comments
 (0)