Skip to content

Commit b56611d

Browse files
dpenklergregkh
authored andcommitted
staging: gpib: Remove dependency on LED subsystem
The yoga pin map is compatible with the others so that its led can be used as the activity led. Using the LED subsytem required adding a dtoverlay to the boot config as well as setting up the activity led via sysfs. To simplify the setup we remove the dependency on the LED subsystem and use the on board led as for the other pin maps. Tested-by: Dave Penkler <dpenkler@gmail.com> Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250418173434.2892-5-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2eab123 commit b56611d

1 file changed

Lines changed: 6 additions & 17 deletions

File tree

drivers/staging/gpib/gpio/gpib_bitbang.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
#include <linux/gpio/machine.h>
6767
#include <linux/gpio.h>
6868
#include <linux/irq.h>
69-
#include <linux/leds.h>
7069

7170
static int sn7516x_used = 1, sn7516x;
7271
module_param(sn7516x_used, int, 0660);
@@ -136,19 +135,14 @@ enum lines_t {
136135
#define SN7516X_PINS 4
137136
#define NUM_PINS (GPIB_PINS + SN7516X_PINS)
138137

139-
DEFINE_LED_TRIGGER(ledtrig_gpib);
140-
#define ACT_LED_ON do { \
138+
#define ACT_LED_ON do { \
141139
if (ACT_LED) \
142-
gpiod_direction_output(ACT_LED, 1); \
143-
else \
144-
led_trigger_event(ledtrig_gpib, LED_FULL); } \
145-
while (0)
146-
#define ACT_LED_OFF do { \
140+
gpiod_direction_output(ACT_LED, 1); \
141+
} while (0)
142+
#define ACT_LED_OFF do { \
147143
if (ACT_LED) \
148-
gpiod_direction_output(ACT_LED, 0); \
149-
else \
150-
led_trigger_event(ledtrig_gpib, LED_OFF); } \
151-
while (0)
144+
gpiod_direction_output(ACT_LED, 0); \
145+
} while (0)
152146

153147
static struct gpio_desc *all_descriptors[GPIB_PINS + SN7516X_PINS];
154148

@@ -1180,8 +1174,6 @@ static int allocate_gpios(struct gpib_board *board)
11801174
}
11811175
if (lookup_table)
11821176
gpiod_remove_lookup_table(lookup_table);
1183-
// Initialize LED trigger
1184-
led_trigger_register_simple("gpib", &ledtrig_gpib);
11851177
return retval;
11861178
}
11871179

@@ -1193,8 +1185,6 @@ static void bb_detach(struct gpib_board *board)
11931185
if (!board->private_data)
11941186
return;
11951187

1196-
led_trigger_unregister_simple(ledtrig_gpib);
1197-
11981188
bb_free_irq(board, &priv->irq_DAV, NAME "_DAV");
11991189
bb_free_irq(board, &priv->irq_NRFD, NAME "_NRFD");
12001190
bb_free_irq(board, &priv->irq_NDAC, NAME "_NDAC");
@@ -1254,7 +1244,6 @@ static int bb_attach(struct gpib_board *board, const struct gpib_board_config *c
12541244
gpios_vector[&(D06) - &all_descriptors[0]] = YOGA_D06_pin_nr;
12551245
gpios_vector[&(PE) - &all_descriptors[0]] = -1;
12561246
gpios_vector[&(DC) - &all_descriptors[0]] = -1;
1257-
gpios_vector[&(ACT_LED) - &all_descriptors[0]] = -1;
12581247
} else {
12591248
dev_err(board->gpib_dev, "Unrecognized pin map %s\n", pin_map);
12601249
goto bb_attach_fail;

0 commit comments

Comments
 (0)