Skip to content

Commit

Permalink
hall_sensor: option to disable magnetic cover
Browse files Browse the repository at this point in the history
Signed-off-by: flar2 <asegaert@gmail.com>
  • Loading branch information
flar2 committed Mar 7, 2018
1 parent 97a5751 commit 5acc638
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/input/misc/hall_sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

#define DRIVER_NAME "HL"

bool disable_cover = 0;
module_param(disable_cover, bool, 0644);

struct ak_hall_data {
struct input_dev *input_dev;
uint32_t gpio_att:16;
Expand Down Expand Up @@ -241,6 +244,9 @@ static void report_cover_event(int pole, int irq, struct ak_hall_data *hl)
{
uint8_t val_n = 0, val_s = 0;

if (disable_cover)
return;

if(pole == HALL_POLE_N) // N-pole
{
val_n = gpio_get_value(hl->gpio_att);
Expand Down

0 comments on commit 5acc638

Please sign in to comment.