From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B616CC2BBD1 for ; Thu, 17 Sep 2020 14:52:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75683206DB for ; Thu, 17 Sep 2020 14:52:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GFS3galh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727790AbgIQOwF (ORCPT ); Thu, 17 Sep 2020 10:52:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727476AbgIQOW7 (ORCPT ); Thu, 17 Sep 2020 10:22:59 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CD29C061224; Thu, 17 Sep 2020 07:14:19 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id w7so1296654pfi.4; Thu, 17 Sep 2020 07:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4unBKDTxzRQRPQZlJUn6A2Soath9XJxD61TMB7PnRfc=; b=GFS3galhGl4pGXPAIFLaGVY3InSJNn9hCDP3n2QvcYIax+EGhdNUkMF7zkwhdzReoH cb3O56eEVi8dIF+YPK/zBXhJ9V5DtYg2RgBY1deepye5Gm2NNXsYfFh92WhGB/acfIXW UD8asOTuv+0Ndipo5Uy3hghSHxuqylYjw8tyAsP5vQdWlUBM28Dk3hFpOdGfDNxBAzJO 7/JmyDR7aKS2qouff8Lo1aq64RHqhmyHFoohyWZVCFGxSr1dMNAKhlnmfnHHLRxcetyH ww3vWCzYf5ZgObokCoVQGFdalgDY6f64rE0Vsy9+UUgrLXUCnd3/f0rG8tP+vbDIhfKx vRUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4unBKDTxzRQRPQZlJUn6A2Soath9XJxD61TMB7PnRfc=; b=FIf4zn4J3oTrpek6sV6oOGKC5Th7sBQX588iVxSZjwXLasu1UXF4Bc0d+YjLsIj8T1 msKxzj63WoDbqSjedRwQcvUEaVpCxdWIkhHdJJAGUXtnrcXQRxKaIbtOLssd5UqZUGg5 gtQPHGsrZ5erBBRRd4lbc54PEeNA6EnkaKvuDblse+2Fu/5KDqYKBJ6VoX0W+A3tQy6t /KuaX9Kmv/Dsq7z4f4WdWc/8DZAyq0LOKqG691qqBVIUgYAB6T9kVgHwzItD9K2Z0Cct 8bejZ+YTpiTLzoc9MNcV1cfgqqir2KFnowCrjq03M4QAbRXVtJQAWp0SzSVUx2eBH9D9 Z3nQ== X-Gm-Message-State: AOAM5325ba0L9DhsbA5LOPYykpYxybeR1j9Y83KDFpEen0Pw4x0FSoCa wEO1l/UAx5d1WeShiatzJ51rs7IRMV25+L0jTpc= X-Google-Smtp-Source: ABdhPJy5qeqotttBdV66/aTb7EtTkcWg7OUAGeLKW75rGS3vVMXitZ6o4V8b0Zq8/QxW2yHX8Om9DwlIoFrEfBI51K4= X-Received: by 2002:a63:ec4c:: with SMTP id r12mr22049725pgj.74.1600352058607; Thu, 17 Sep 2020 07:14:18 -0700 (PDT) MIME-Version: 1.0 References: <20200916213618.8003-1-djrscally@gmail.com> <20200917103343.GW26842@paasikivi.fi.intel.com> <8133a57d-ab4c-dccd-4325-9b10e7805648@gmail.com> <20200917124514.GK3956970@smile.fi.intel.com> In-Reply-To: From: Andy Shevchenko Date: Thu, 17 Sep 2020 17:14:00 +0300 Message-ID: Subject: Re: [RFC PATCH] Add bridge driver to connect sensors to CIO2 device via software nodes on ACPI platforms To: Dan Scally , Hans de Goede , Mark Gross Cc: Andy Shevchenko , Sakari Ailus , Yong Zhi , Bingbu Cao , Tian Shu Qiu , Mauro Carvalho Chehab , Greg Kroah-Hartman , "David S. Miller" , Rob Herring , Linux Kernel Mailing List , Linux Media Mailing List , "open list:STAGING SUBSYSTEM" , jorhand@linux.microsoft.com, Tsuchiya Yuto , kieran.bingham@ideasonboard.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 17, 2020 at 4:53 PM Dan Scally wrote: > > Hi Andy, thanks for input (as always) You're welcome! I'm really impressed by your activity in this area. > On 17/09/2020 13:45, Andy Shevchenko wrote: > > On Thu, Sep 17, 2020 at 11:52:28AM +0100, Dan Scally wrote: > >> On 17/09/2020 11:33, Sakari Ailus wrote: To the point of placement, I think this should go under drivers/platform/x86 (Adding Hans and Mark, who can express their opinions). ... > > Ah, I think you misinterpreted the meaning of above. The above is a switch how > > camera device appears either as PCI or an ACPI. So, it effectively means you > > should *not* have any relation for this HID until you find a platform where the > > device is for real enumerated via ACPI. > > > Ah, ok. So that was never going to work. Thanks. That does raise another > question; we have had some testers report failure, which turns out to be > because on their platforms the definition of their cameras in ACPI is > never translated into an i2c_client so the cio2-bridge doesn't bind. > Those have a similar conditional in the _STA method, see CAM1 in this > DSDT for example: > https://raw.githubusercontent.com/linux-surface/acpidumps/master/surface_go/dsdt.dsl. > Is there anything we can do to enable those cameras to be discovered too? It means that this ... > >>>> +#define PROPERTY_ENTRY_NULL \ > >>>> +((const struct property_entry) { }) > >>> Alignment. Same appears to apply to other macros (please indent). > >> Yep > >>>> +#define SOFTWARE_NODE_NULL \ > >>>> +((const struct software_node) { }) > > Why?! > > > It felt ugly to have the other definitions be macros and not this one, > but I can change it. My point is that those macros are simply redundant. The point is to have a terminator record (all 0:s in the last entry of an array) which is usually being achieved by allocating memory with kcalloc() which does implicitly this for you. -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30180C433E2 for ; Thu, 17 Sep 2020 14:14:26 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B3922078D for ; Thu, 17 Sep 2020 14:14:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GFS3galh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B3922078D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 21027878DF; Thu, 17 Sep 2020 14:14:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I-OVuI0rhH5U; Thu, 17 Sep 2020 14:14:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 323CA878E1; Thu, 17 Sep 2020 14:14:21 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id BCE301BF399 for ; Thu, 17 Sep 2020 14:14:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B956187627 for ; Thu, 17 Sep 2020 14:14:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id khC26iZXaNib for ; Thu, 17 Sep 2020 14:14:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by hemlock.osuosl.org (Postfix) with ESMTPS id 1DF6087626 for ; Thu, 17 Sep 2020 14:14:19 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id l126so1295913pfd.5 for ; Thu, 17 Sep 2020 07:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4unBKDTxzRQRPQZlJUn6A2Soath9XJxD61TMB7PnRfc=; b=GFS3galhGl4pGXPAIFLaGVY3InSJNn9hCDP3n2QvcYIax+EGhdNUkMF7zkwhdzReoH cb3O56eEVi8dIF+YPK/zBXhJ9V5DtYg2RgBY1deepye5Gm2NNXsYfFh92WhGB/acfIXW UD8asOTuv+0Ndipo5Uy3hghSHxuqylYjw8tyAsP5vQdWlUBM28Dk3hFpOdGfDNxBAzJO 7/JmyDR7aKS2qouff8Lo1aq64RHqhmyHFoohyWZVCFGxSr1dMNAKhlnmfnHHLRxcetyH ww3vWCzYf5ZgObokCoVQGFdalgDY6f64rE0Vsy9+UUgrLXUCnd3/f0rG8tP+vbDIhfKx vRUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4unBKDTxzRQRPQZlJUn6A2Soath9XJxD61TMB7PnRfc=; b=XNhMiT+a//mExCgUVLjr5HspcbMAScmeFihRm0aYWR7rUqacAYB40MR+6ZKSe+6An0 5XOSROhD3HsPn3N3e180lq795bjO22+C95daqA0G1cAQ6d0sQt+Mpefot39mDsm6Z2Cp bvgJIU6iowDngpz4SmvAoP9D24qvnG/Vp8Fy//F/Xt+FI+SbLl4sthjEbnmQZQvnsmGE 0Vv5mzY7UAbVqgAzwaPgOffUYHedfh55TCoHGv0Ru6QKxFFlZpHCzzy4huaUirrli/Ya nHIKlOwT9iYfzoV5SfIvT4PZaY4PGt6KFvSWiaGc2Kh1vQROtK9KFzUCchfF3m/U2DyJ Rvdg== X-Gm-Message-State: AOAM532kVxy97vmuRW3kj1PzYZ0M/GfV7fVRQtEJ8d79cW3LVv6RXHG0 9Nx3TXi3xUBOdrC1xx0HV+o94XxmP4ZEhJzzRPw= X-Google-Smtp-Source: ABdhPJy5qeqotttBdV66/aTb7EtTkcWg7OUAGeLKW75rGS3vVMXitZ6o4V8b0Zq8/QxW2yHX8Om9DwlIoFrEfBI51K4= X-Received: by 2002:a63:ec4c:: with SMTP id r12mr22049725pgj.74.1600352058607; Thu, 17 Sep 2020 07:14:18 -0700 (PDT) MIME-Version: 1.0 References: <20200916213618.8003-1-djrscally@gmail.com> <20200917103343.GW26842@paasikivi.fi.intel.com> <8133a57d-ab4c-dccd-4325-9b10e7805648@gmail.com> <20200917124514.GK3956970@smile.fi.intel.com> In-Reply-To: From: Andy Shevchenko Date: Thu, 17 Sep 2020 17:14:00 +0300 Message-ID: Subject: Re: [RFC PATCH] Add bridge driver to connect sensors to CIO2 device via software nodes on ACPI platforms To: Dan Scally , Hans de Goede , Mark Gross X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:STAGING SUBSYSTEM" , Rob Herring , Andy Shevchenko , jorhand@linux.microsoft.com, Linux Media Mailing List , Greg Kroah-Hartman , Linux Kernel Mailing List , kieran.bingham@ideasonboard.com, Tsuchiya Yuto , Sakari Ailus , Bingbu Cao , Mauro Carvalho Chehab , "David S. Miller" , Tian Shu Qiu , Yong Zhi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Thu, Sep 17, 2020 at 4:53 PM Dan Scally wrote: > > Hi Andy, thanks for input (as always) You're welcome! I'm really impressed by your activity in this area. > On 17/09/2020 13:45, Andy Shevchenko wrote: > > On Thu, Sep 17, 2020 at 11:52:28AM +0100, Dan Scally wrote: > >> On 17/09/2020 11:33, Sakari Ailus wrote: To the point of placement, I think this should go under drivers/platform/x86 (Adding Hans and Mark, who can express their opinions). ... > > Ah, I think you misinterpreted the meaning of above. The above is a switch how > > camera device appears either as PCI or an ACPI. So, it effectively means you > > should *not* have any relation for this HID until you find a platform where the > > device is for real enumerated via ACPI. > > > Ah, ok. So that was never going to work. Thanks. That does raise another > question; we have had some testers report failure, which turns out to be > because on their platforms the definition of their cameras in ACPI is > never translated into an i2c_client so the cio2-bridge doesn't bind. > Those have a similar conditional in the _STA method, see CAM1 in this > DSDT for example: > https://raw.githubusercontent.com/linux-surface/acpidumps/master/surface_go/dsdt.dsl. > Is there anything we can do to enable those cameras to be discovered too? It means that this ... > >>>> +#define PROPERTY_ENTRY_NULL \ > >>>> +((const struct property_entry) { }) > >>> Alignment. Same appears to apply to other macros (please indent). > >> Yep > >>>> +#define SOFTWARE_NODE_NULL \ > >>>> +((const struct software_node) { }) > > Why?! > > > It felt ugly to have the other definitions be macros and not this one, > but I can change it. My point is that those macros are simply redundant. The point is to have a terminator record (all 0:s in the last entry of an array) which is usually being achieved by allocating memory with kcalloc() which does implicitly this for you. -- With Best Regards, Andy Shevchenko _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel