Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp632257ybl; Wed, 8 Jan 2020 03:19:31 -0800 (PST) X-Google-Smtp-Source: APXvYqw63kzfoceViAjrgiwsu/T62jMjXek1wynuYvFsgyJV76YWiSZ1mT5rXTSHTuWP/DQ2qfJ0 X-Received: by 2002:aca:d6c8:: with SMTP id n191mr2769451oig.103.1578482371284; Wed, 08 Jan 2020 03:19:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578482371; cv=none; d=google.com; s=arc-20160816; b=U0y1w+khHdJoC4qIRaJmAh60dv4RfWEoXeQzPnxP3NaKsWlnU3ZbGLRjm33G75EbDR MOelGucxt00rmB1gThtsAhI4v5lkm844lDhdwiK+FbuFKLkx5bYypqbSj9v6p8CtVNNY WV079phlzoRg0RkGkP5uUkvIAJoLBSnpCmmAwfBFIxAsKktT6ppcmssAwj9qd7+QT5T2 Qk4tWuibDwlHCX8G6AXBZ7sP3OH3VERnaRZNEMsr/DnGOb5t8iyedBawiF4/espx8n2q Z+w6di9zk6LMAJHrJGqeOr/X37xQ7CNvmQNbuVK2J0hs9sCK+7H2TF6IuofnUJI5Fpj6 lQKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=FfacdSr5fWc71HsnbeA7xFKPvjQ9vTnbrDRjuOeEKuE=; b=g1iwFi45mgMNmKXZu0FtGxBbIcEMdOfB6eVv3yeFq1Dz8Vw+0jQNunvuD3T7ZxWYzF a6wVuBciWRNw8LuiAuvbCTEMTuXTEugyNNn2z46+1cvylDzC/4RHXzL34PDQX70DoTgk XGlDxPBXDrYaJDpKZpE5ObxjfPYW2Rvd2l9vYLK8+CIPT3jwGo6+JLkSDL0SgoCCMZ+y Oj4Qq1MEvY/Sd52/P0+n7T+sx3N1LEsNmpL9Z3xVC2cJObP3BaJ4yqqFBJx0DEEvHTKa Furd1jrojF3K743aPFeLr/9uUPHCFiw/dowKg3bUBAj4y8EkhnXR5GB0Qmx+8GGhG/AY Y+7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22si1657305oti.269.2020.01.08.03.19.19; Wed, 08 Jan 2020 03:19:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727852AbgAHKjD (ORCPT + 99 others); Wed, 8 Jan 2020 05:39:03 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:54866 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727145AbgAHKjD (ORCPT ); Wed, 8 Jan 2020 05:39:03 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id AFB7F2920FA Subject: Re: [PATCH] platform/chrome: wilco_ec: Fix keyboard backlight probing To: Daniel Campello , LKML Cc: Nick Crews , Benson Leung References: <20200107112400.1.Iedcdbae5a7ed79291b557882130e967f72168a9f@changeid> From: Enric Balletbo i Serra Message-ID: Date: Wed, 8 Jan 2020 11:38:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <20200107112400.1.Iedcdbae5a7ed79291b557882130e967f72168a9f@changeid> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, Many thanks for sending the patch upstream. On 7/1/20 19:24, Daniel Campello wrote: > The EC on the Wilco platform responds with 0xFF to commands related to > the keyboard backlight on the absence of a keyboard backlight module. > This change allows the EC driver to continue loading even if the > backlight module is not present. > Could you explain a bit more which is the problem you're trying to solve? I am not sure I understand it, isn't the kbbl_exist call for that purpose? (in absence of the keyboard backligh module just don't init the device?) Thanks, Enric > Signed-off-by: Daniel Campello > --- > > .../platform/chrome/wilco_ec/keyboard_leds.c | 28 +++++++++++++------ > 1 file changed, 20 insertions(+), 8 deletions(-) > > diff --git a/drivers/platform/chrome/wilco_ec/keyboard_leds.c b/drivers/platform/chrome/wilco_ec/keyboard_leds.c > index bb0edf51dfda..5731d1b60e28 100644 > --- a/drivers/platform/chrome/wilco_ec/keyboard_leds.c > +++ b/drivers/platform/chrome/wilco_ec/keyboard_leds.c > @@ -73,13 +73,6 @@ static int send_kbbl_msg(struct wilco_ec_device *ec, > return ret; > } > > - if (response->status) { > - dev_err(ec->dev, > - "EC reported failure sending keyboard LEDs command: %d", > - response->status); > - return -EIO; > - } > - > return 0; > } > > @@ -87,6 +80,7 @@ static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness) > { > struct wilco_keyboard_leds_msg request; > struct wilco_keyboard_leds_msg response; > + int ret; > > memset(&request, 0, sizeof(request)); > request.command = WILCO_EC_COMMAND_KBBL; > @@ -94,7 +88,18 @@ static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness) > request.mode = WILCO_KBBL_MODE_FLAG_PWM; > request.percent = brightness; > > - return send_kbbl_msg(ec, &request, &response); > + ret = send_kbbl_msg(ec, &request, &response); > + if (ret < 0) > + return ret; > + > + if (response.status) { > + dev_err(ec->dev, > + "EC reported failure sending keyboard LEDs command: %d", > + response.status); > + return -EIO; > + } > + > + return 0; > } > > static int kbbl_exist(struct wilco_ec_device *ec, bool *exists) > @@ -140,6 +145,13 @@ static int kbbl_init(struct wilco_ec_device *ec) > if (ret < 0) > return ret; > > + if (response.status) { > + dev_err(ec->dev, > + "EC reported failure sending keyboard LEDs command: %d", > + response.status); > + return -EIO; > + } > + > if (response.mode & WILCO_KBBL_MODE_FLAG_PWM) > return response.percent; > > -- > 2.24.1.735.g03f4e72817-goog >