Skip to content

Commit

Permalink
KLAPSE : Use appropriate callback for data types
Browse files Browse the repository at this point in the history
Signed-off-by: Tanish Manku <tanish2k09.dev@gmail.com>
Signed-off-by: kingbri <bdashore3@gmail.com>
  • Loading branch information
tanish2k09 authored and acuicultor committed Dec 18, 2020
1 parent 091f5ec commit 2dd582c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions drivers/video/klapse/klapse.c
Expand Up @@ -26,8 +26,8 @@ static unsigned short dimmer = 100;
static unsigned int bl_lower = LOWER_BL_LVL;
static unsigned int bl_upper = UPPER_BL_LVL;
static unsigned int pulse_freq = 30000;
static int fadeback_min = 90;
static int target_minute = 300;
static unsigned int fadeback_min = 90;
static unsigned int target_minute = 300;
static bool dimmer_auto = 0;
static unsigned int dimmer_start_minute = 1380;
static unsigned int dimmer_stop_minute = 360;
Expand Down Expand Up @@ -314,13 +314,11 @@ void set_rgb_slider(bl_type_t bl_lvl)
static void set_enabled(unsigned short val)
{
if ((val == 1) && (enabled != 1)) {
flush_flow_timer();
flush_timer();
enabled = 1;
pulse(0);
return;
} else if (val == 0) {
flush_flow_timer();
set_rgb_brightness(daytime_r, daytime_g, daytime_b);
current_r = daytime_r;
current_g = daytime_g;
Expand Down Expand Up @@ -385,7 +383,7 @@ static int param_rgb_set(const char *buf, const struct kernel_param *kp)
if (tmp < MIN_SCALE || tmp > MAX_SCALE)
return -EINVAL;

param_set_uint(buf, kp);
param_set_ushort(buf, kp);

if (enabled == 2) {
set_rgb_slider(last_bl);
Expand Down Expand Up @@ -527,22 +525,22 @@ static int param_freqs_set(const char *buf, const struct kernel_param *kp)

static const struct kernel_param_ops enabled_param_ops = {
.set = param_enabled_set,
.get = param_get_uint,
.get = param_get_ushort,
};

static const struct kernel_param_ops dimmer_param_ops = {
.set = param_dimmer_set,
.get = param_get_uint,
.get = param_get_ushort,
};

static const struct kernel_param_ops dimmer_auto_param_ops = {
.set = param_dimmer_auto_set,
.get = param_get_uint,
.get = param_get_bool,
};

static const struct kernel_param_ops rgb_param_ops = {
.set = param_rgb_set,
.get = param_get_uint,
.get = param_get_ushort,
};

static const struct kernel_param_ops transition_param_ops = {
Expand Down

0 comments on commit 2dd582c

Please sign in to comment.