Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp246158iob; Mon, 2 May 2022 18:24:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/PXYwgPQvmuMbzD8PYpmmj43v2CvjnGt8VF8Tsutr3qE6oV0H+YkrQSLIktYqH0aN+M65 X-Received: by 2002:a17:902:a404:b0:14b:1100:aebc with SMTP id p4-20020a170902a40400b0014b1100aebcmr14463107plq.133.1651541054068; Mon, 02 May 2022 18:24:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651541054; cv=none; d=google.com; s=arc-20160816; b=Vof4bfa0WlHh8Gc0xGtZ5Xu1rbus0IFfYpY5ynQlD8W+1YJxso50jfd77w2Rdmjfhi 3EU4c0vPT5F6FKaNqWPlJDiTAUuMBO2w+lBmztT5M7dUoGSJdV38sqhWd85+CQ9+CZSw jYkNGbOLGGUkevlS0scZ8iY1mv3BzW36fFFAyvspGK4SNfhKR70Mfe4uHq2jWWy03rsc wgXi2sVlaz/nPxxUtIcTPcXuY8tYnwcoliQ6oNA8HhztCY8m4RGLEmVXdT7zA9f4D8Gj pr+m+eudTE+J8BIW5lF2Yp1F6pOppe/5raFc+RkBdC4FdUj6GAAgdVAOE+1porxH6FkI XZ9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=DVGl7FkDnsPKOHoFcMwejH9+UyHbejyve2Ejii4IrCM=; b=G+bKwD1xVMSE3o3Yta2Tkd0Z0RloW/gDWGBzzuLziWXIwlwxbPsQPo1kRGKdMwyU8s g6h6aoZJxuuDDbd2nVlvYeMOV7eH2ihgrfbNsIOBzqJEynkaEL8ryh+cCdM4Iyx77YCs I6k/1Wfd/4lorRPx4oTJGlKxuWLZgbVG4kLECUEtx0j5qzMZzhjDrhKambzxrAaEMcJd 6DlWO/WeEO3leuNUYt1KZdgzh7/JJnQQW/QRIiRDUKLWJ+l4dFYDQFZ+xjjPJM179DXZ uKrNIkr81cQakMq3UCqMCdD1149mxAksmUui0W/EUicV2pK7ZCLrNU09eFdXmWgUnwju focw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="I/045iRJ"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q5-20020a170902eb8500b00158f777bbbfsi7099717plg.559.2022.05.02.18.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 18:24:14 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="I/045iRJ"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7C91A43AE2; Mon, 2 May 2022 18:03:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387846AbiEBWIn (ORCPT + 99 others); Mon, 2 May 2022 18:08:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387857AbiEBWGg (ORCPT ); Mon, 2 May 2022 18:06:36 -0400 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 778B110FFF for ; Mon, 2 May 2022 15:02:20 -0700 (PDT) Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-ed8a3962f8so5518746fac.4 for ; Mon, 02 May 2022 15:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=DVGl7FkDnsPKOHoFcMwejH9+UyHbejyve2Ejii4IrCM=; b=I/045iRJlecCmWvj4tuUqOFvKpEZtT7cA11HAymgVZw3gEMruV1NZCIRvMymbscBeU dEht4NLFVxHkpjemr8/2TfL+kpJYJCZ/mOJFXkrSEyLvNv5ad/bKDKESNL8CtWHitgxT dMQp7ewk/SoaMMUwrO7Dk03tZsaGBDSALyKwg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=DVGl7FkDnsPKOHoFcMwejH9+UyHbejyve2Ejii4IrCM=; b=pN1hA/cKMbBfhWB9s76Bmq8tZ0CYE07lrFQ/B9FowisQW4+NayvKCV3FMD/K+Dglsu chbK8YHN4xYvaIJifgVDjB44d431uKP8EqgoFaC/MMa2x6hkfaZQ1b6O4mEOQLgQj8g1 sbPM3ubPnF24WY+5QkBXA/1ZoRi2t+Uzb7/SpM9ybUxJGqx2ZWMYNhJBxTyZ1v6824gk P0j1M7VAQQZP3y6YLIgruKfH9z1Yv8Yyy/BwXuNA/RiBnjNZTmrMRFhaeaK8b5FDFZzj qIuFu4SEUbnA4pfwbBY8zHFGHBj32Y7h2XIf/hlmlgVG6Z4YBZvqphGKa07+TrhJflns hX5w== X-Gm-Message-State: AOAM530S8uHUarf2GWRKlfrDs3Lu4ynG7r7XsS8Z0ZGMXkslY0BQd197 WboPmqAcJpOqaxQql5KiMPHJ69+xXZgzmkTa2UEC2g== X-Received: by 2002:a05:6870:40c1:b0:ed:9a12:3f95 with SMTP id l1-20020a05687040c100b000ed9a123f95mr525995oal.193.1651528939865; Mon, 02 May 2022 15:02:19 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 2 May 2022 15:02:19 -0700 MIME-Version: 1.0 In-Reply-To: References: <20220429233112.2851665-1-swboyd@chromium.org> <20220429233112.2851665-3-swboyd@chromium.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Mon, 2 May 2022 15:02:19 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] Input: cros-ec-keyb - skip keyboard registration for switches compatible To: Doug Anderson Cc: Dmitry Torokhov , LKML , patches@lists.linux.dev, chrome-platform@lists.linux.dev, Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, Benson Leung , Guenter Roeck , Hsin-Yi Wang , "Joseph S. Barrera III" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Doug Anderson (2022-05-02 10:02:54) > On Fri, Apr 29, 2022 at 4:31 PM Stephen Boyd wrote: > > > > > > diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c > > index eef909e52e23..1bbe2987bf52 100644 > > --- a/drivers/input/keyboard/cros_ec_keyb.c > > +++ b/drivers/input/keyboard/cros_ec_keyb.c > > @@ -536,6 +536,12 @@ static int cros_ec_keyb_register_matrix(struct cros_ec_keyb *ckdev) > > u32 *physmap; > > u32 key_pos; > > unsigned int row, col, scancode, n_physmap; > > + bool register_keyboard; > > + > > + /* Skip matrix registration if no keyboard */ > > + register_keyboard = device_get_match_data(dev); > > + if (!register_keyboard) > > + return 0; > > > > /* > > * No rows and columns? There isn't a matrix but maybe there are > > As per my comments in patch #1, I wonder if it makes sense to delete > the "No rows and columns?" logic and settle on the compatible as the > one true way to specify this. > Ok. My only concern is that means we have to check for both compatibles which is not really how DT compatible strings work. The compatible string usually finds the more specific compatible that is first in the list of compatibles in DT. You're essentially proposing that the switches compatible could be first or last, the order doesn't matter. If that isn't a problem then we can roll in a revert of commit 4352e23a7ff2 ("Input: cros-ec-keyb - only register keyboard if rows/columns exist") and leave the rest of this patch alone and it will implement this logic.