Skip to content

Commit

Permalink
Rename two functions to align them with naming convention
Browse files Browse the repository at this point in the history
Driver uses "set" everywhere to indicate setting report values and
requesting HID_REQ_SET_REPORT
  • Loading branch information
Lawstorant committed Feb 26, 2025
1 parent 611d9e7 commit 37bfb4a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions hid-pidff.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,9 @@ static void pidff_set_gain_report(struct pidff_device *pidff, u16 gain)
}

/*
* Clear device control report
* Send device control report to the device
*/
static void pidff_send_device_control(struct pidff_device *pidff, int field)
static void pidff_set_device_control(struct pidff_device *pidff, int field)
{
int i, index;
int field_index = pidff->control_id[field];
Expand Down Expand Up @@ -594,10 +594,10 @@ static void pidff_send_device_control(struct pidff_device *pidff, int field)
/*
* Modify actuators state
*/
static void pidff_modify_actuators_state(struct pidff_device *pidff, bool enable)
static void pidff_set_actuators(struct pidff_device *pidff, bool enable)
{
hid_dbg(pidff->hid, "%s actuators\n", enable ? "enable" : "disable");
pidff_send_device_control(pidff,
pidff_set_device_control(pidff,
enable ? PID_ENABLE_ACTUATORS : PID_DISABLE_ACTUATORS);
}

Expand All @@ -607,12 +607,12 @@ static void pidff_modify_actuators_state(struct pidff_device *pidff, bool enable
static void pidff_reset(struct pidff_device *pidff)
{
/* We reset twice as sometimes hid_wait_io isn't waiting long enough */
pidff_send_device_control(pidff, PID_RESET);
pidff_send_device_control(pidff, PID_RESET);
pidff_set_device_control(pidff, PID_RESET);
pidff_set_device_control(pidff, PID_RESET);
pidff->effect_count = 0;

pidff_send_device_control(pidff, PID_STOP_ALL_EFFECTS);
pidff_modify_actuators_state(pidff, 1);
pidff_set_device_control(pidff, PID_STOP_ALL_EFFECTS);
pidff_set_actuators(pidff, 1);
}

/*
Expand Down

0 comments on commit 37bfb4a

Please sign in to comment.