From 0ff9e823c3b70ae56706bee178a435f713f323fe Mon Sep 17 00:00:00 2001 From: Nabeel Sowan Date: Tue, 13 Oct 2015 17:46:15 +0200 Subject: [PATCH] sx9512: create LED intensity and touch sensitivity board config options, refs #7932 --- peripheral_manager/src/src/touch_sx9512.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/peripheral_manager/src/src/touch_sx9512.c b/peripheral_manager/src/src/touch_sx9512.c index 206161336..cba719848 100644 --- a/peripheral_manager/src/src/touch_sx9512.c +++ b/peripheral_manager/src/src/touch_sx9512.c @@ -388,7 +388,21 @@ void sx9512_handler_init(struct server_ctx *s_ctx) DBG(1, "sx9512_active_led_channels = [%02X]", sx9512_active_led_channels); sx9512_reg_nvm_init_defaults(&nvm, sx9512_active_capsense_channels, sx9512_active_led_channels); - + + if((s=ucix_get_option(s_ctx->uci_ctx, "hw", "board", "sx9512_led_intensity"))) { + nvm.led2_on = nvm.led1_on = strtol(s,0,16); + DBG(1, "sx9512_led_intensity = [%02X]", nvm.led1_on); + } + + for(i=0;i<8;i++) { + char tmpstr[22]; + sprintf(tmpstr, "sx9512_threshold_bl%d", i); + if((s=ucix_get_option(s_ctx->uci_ctx, "hw", "board", tmpstr))) { + nvm.cap_sense_thresh[i] = strtol(s,0,16); + DBG(1, "sx9512_threshold_bl%d = [%02X]", i, nvm.cap_sense_thresh[i]); + } + } + LIST_HEAD(sx9512_init_regs); struct ucilist *node; ucix_get_option_list(s_ctx->uci_ctx, "hw","sx9512_init_regs", "regs", &sx9512_init_regs);