Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3545821pxu; Mon, 30 Nov 2020 05:35:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHERGFhIXpBtm/2PU7UgDDyP7L7B+JK9Q+5BLuibcFeeTESRE4+cnIvi/KzS437bxYHwvn X-Received: by 2002:a17:906:6414:: with SMTP id d20mr20731885ejm.82.1606743325835; Mon, 30 Nov 2020 05:35:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606743325; cv=none; d=google.com; s=arc-20160816; b=KbeP4E3sWwU+VpC2+oIsr4gPRTBwzz/XuKe6ANfSl4AQMK/Ffj9UnU9rvyPCgIwf6I k2qFx6B4oycDE1C3Chwtvc//czUqk0mOhwAmuEZInc4adG7Bzfm5HYDZCpO006vEH1db GTqVcjgaDHv1C00tZrLi5HNi+MtfM5M9ZtqiSuEsLT3Nm8WIyuct31xp6WPCqVrje7JZ YvGHtHimEjBe2QrNbyxcjuawZJLsWnJhvyOPWhurYl6Kf7G2R2fw+hjFvFgmGKbyPQl9 0r8/krG6em31ReQxixgAh8pNPIA0K6WCZwbyNZHk0BjN8/CCpi3Pba1yR7f2VCRGrYnA q4ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=OohUDjp6HEgwFCMO0olHO61AfJV21cETxnMeTMXANPE=; b=iXnhjNzKyYZICRcAI8ugbNRsBC0fjvu67m1OeSqk442UdNOy4+1vQlgBuYS55VbTNh 5cJlOYSfCNFHhcySP2+du7n+YVgE81L+/S6QsjDEq2WBBtBfOsRjMWIn7gUEEik7WbhK j6qEWTeEPQc82RbwXuANLNmtTa+GMEJzyN8e4Vz0HZJrsg/SGFCJzDm+JWxuTTOohUs3 E51LDYQvGy+LWvsD8+TytS0TUrSWy+US9K1Swpvk7EOrvVKAOzMw7T8nLeMhTyAu9sy+ wMf0ayv6S0P8T2vZaI7kl/hBwqs7V66hluZzqwG7H8UolRy0aiZSqaN1yyEXm451iKGA hkmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LEEf+aDf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si10405663edk.251.2020.11.30.05.35.02; Mon, 30 Nov 2020 05:35:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LEEf+aDf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726803AbgK3Ncf (ORCPT + 99 others); Mon, 30 Nov 2020 08:32:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbgK3Nce (ORCPT ); Mon, 30 Nov 2020 08:32:34 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9138C0613CF; Mon, 30 Nov 2020 05:31:53 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id s8so16206500wrw.10; Mon, 30 Nov 2020 05:31:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OohUDjp6HEgwFCMO0olHO61AfJV21cETxnMeTMXANPE=; b=LEEf+aDfTzgycqlcDqg7AO6TQ+daYocnGIKufN7HaBFo7no9n+QWHT7G6y6QpnbfFB 9tcr/5p+6N/pbAVl+ektMve/T6qZcluAPnXVoUG9vCEiZ0vFo6+seRUKdt0iHGoCRchc VbvxYQd4r6ziLeS94h0hEi93aP9Ft2YO89nT0w3gnROBGSnF7CI9Dld1kdsUcGgXPbLl zlvLjGKJ3J/Q6+A4NQwKJLeLFzXrYYGywCbFihnhfJDh3yAGIz58Dx3xpdVXUYoaQX8d yb3RkB2l62Z9R8dpnfWc1qjcVpn69+5yT1Vbtm1LEedBsDXFBP/iDACXzQ1F//IgF3Xi 1QwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OohUDjp6HEgwFCMO0olHO61AfJV21cETxnMeTMXANPE=; b=HbQFhW++PQlKvyPHBAOKlN0y5u19lrhWgUO3wzlege5NiUmGBFjA3gbhsz32rVFddj uLVTwTGnkgUdq7+S4Dr3tA+Xjkap/ZX8KsWX4V2hM0/lhzIlX0jzVCu+vxe2VJ0cItcX Rox7c/ipadVmLOmm6g/EpJKE2y3zu4wzwuc7dtpECAMdKYpvM5FOXEEyZLV62JXrVQUK AyLLJQpHkrES2Tnf63YegAVOlh+D2zA2eHXQZhisC5LyUMyEUuVda9sbmWbaZs57xUvp 2ZrWxNKrpKA5Rk72kLwPqkimHYSNEql7sgFCxXwIKCK8zI/Bl0Wt986YrQQBG1V5ELfx Bm/A== X-Gm-Message-State: AOAM532t9tU2wtslHtXEY+BwQN7cZkUqRUvyY4T3e+tQ/ViZ8hbl6Vh5 hLIZlCXwR0G1SCP2Y9uCes9nvBXYZp0gVnQF X-Received: by 2002:a05:6000:14b:: with SMTP id r11mr29006695wrx.53.1606743112313; Mon, 30 Nov 2020 05:31:52 -0800 (PST) Received: from valhalla.home ([2.31.224.80]) by smtp.gmail.com with ESMTPSA id g192sm7452333wme.48.2020.11.30.05.31.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 05:31:51 -0800 (PST) From: Daniel Scally To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org, linux-media@vger.kernel.org, devel@acpica.org Cc: rjw@rjwysocki.net, lenb@kernel.org, gregkh@linuxfoundation.org, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, linus.walleij@linaro.org, bgolaszewski@baylibre.com, wsa@kernel.org, yong.zhi@intel.com, sakari.ailus@linux.intel.com, bingbu.cao@intel.com, tian.shu.qiu@intel.com, mchehab@kernel.org, robert.moore@intel.com, erik.kaneda@intel.com, pmladek@suse.com, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, linux@rasmusvillemoes.dk, kieran.bingham+renesas@ideasonboard.com, jacopo+renesas@jmondi.org, laurent.pinchart+renesas@ideasonboard.com, jorhand@linux.microsoft.com, kitakar@gmail.com, heikki.krogerus@linux.intel.com Subject: [PATCH 00/18] Add functionality to ipu3-cio2 driver allowing software_node connections to sensors on platforms designed for Windows Date: Mon, 30 Nov 2020 13:31:11 +0000 Message-Id: <20201130133129.1024662-1-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello all Previous version: https://lore.kernel.org/linux-media/20201019225903.14276-1-djrscally@gmail.com/ This series aims to add support for webcams on laptops with ACPI tables designed for use with CIO2 on Windows. There are two main parts; the first is extending the ipu3-cio2 driver to allow for patching the firmware via software_nodes if endpoints aren't defined by ACPI. Patch #13 deals directly with that, all preceding patches are either supplemental changes or incidental fixes along the way. The second main part is a way to handle the unusual definition of resource destined for the sensors in these ACPI tables; regulators and GPIO lines that are supposed to be consumed by the sensor are lumped in the _CRS of a dummy ACPI device upon which the sensor is dependent. Patch 18 defines a new driver to handle those dummy devices and map the resources to the sensor instead. 14-17 are supporting changes for that driver. Changelogs mostly in the individual patches, but a broad summary: - Altered fwnode_device_is_available() to return true if the fwnode_handle doesn't implement that operation. - Altered fwnode_graph_get_endpoint_by_id() to parse secondary if no endpoint found on primary. - Enforce parent->child ordering of software_nodes on registration - Added a function to get the next ACPI device with matching _HID, plus an iterator macro - Altered cio2-bridge.c to store the bridge struct (and basically everything else) in heap, plus removed the requirement to delay ipu3-cio2 probe until after the i2c devices were instantiated. Also now ensured we handle multiple sensors with the same _HID. - Added a function to get devices _dependent_ on a given ACPI dev, according to their _DEP entries. - Added a function to explicitly construct the name of an I2C dev created from an ACPI dev. - Added a driver to handle the dummy ACPI devices discussed above. Comments very welcome! Dan Scally (1): i2c: i2c-core-base: Use the new i2c_acpi_dev_name() in i2c_set_dev_name() Daniel Scally (16): property: Return true in fwnode_device_is_available for node types that do not implement this operation property: Add support for calling fwnode_graph_get_endpoint_by_id() for fwnode->secondary software_node: Fix failure to put() and get() references to children in software_node_get_next_child() software_node: Enforce parent before child ordering of nodes array for software_node_register_nodes() software_node: Alter software_node_unregister_nodes() to unregister the array in reverse order software_node: amend software_node_unregister_node_group() to perform unregistration of array in reverse order to be consistent with software_node_unregister_nodes() lib/test_printf.c: Use helper function to unwind array of software_nodes ipu3-cio2: Add T: entry to MAINTAINERS ipu3-cio2: Rename ipu3-cio2.c to allow module to be built from multiple source files retaining ipu3-cio2 name media: v4l2-core: v4l2-async: Check possible match in match_fwnode based on sd->fwnode->secondary acpi: Add acpi_dev_get_next_match_dev() and macro to iterate through acpi_devices matching a given _HID ipu3-cio2: Add functionality allowing software_node connections to sensors on platforms designed for Windows acpi: utils: Add function to fetch dependent acpi_devices i2c: i2c-core-acpi: Add i2c_acpi_dev_name() gpio: gpiolib-acpi: Export acpi_get_gpiod() ipu3: Add driver for dummy INT3472 ACPI device Heikki Krogerus (1): software_node: Add support for fwnode_graph*() family of functions MAINTAINERS | 9 + drivers/acpi/utils.c | 98 ++++- drivers/base/property.c | 9 + drivers/base/swnode.c | 157 +++++++- drivers/gpio/gpiolib-acpi.c | 3 +- drivers/i2c/i2c-core-acpi.c | 14 + drivers/i2c/i2c-core-base.c | 2 +- drivers/media/pci/intel/ipu3/Kconfig | 32 ++ drivers/media/pci/intel/ipu3/Makefile | 4 + drivers/media/pci/intel/ipu3/cio2-bridge.c | 260 ++++++++++++ drivers/media/pci/intel/ipu3/cio2-bridge.h | 108 +++++ drivers/media/pci/intel/ipu3/int3472.c | 381 ++++++++++++++++++ drivers/media/pci/intel/ipu3/int3472.h | 96 +++++ .../ipu3/{ipu3-cio2.c => ipu3-cio2-main.c} | 27 ++ drivers/media/pci/intel/ipu3/ipu3-cio2.h | 6 + drivers/media/v4l2-core/v4l2-async.c | 8 + include/acpi/acpi_bus.h | 9 + include/linux/acpi.h | 5 + include/linux/i2c.h | 5 + lib/test_printf.c | 4 +- 20 files changed, 1213 insertions(+), 24 deletions(-) create mode 100644 drivers/media/pci/intel/ipu3/cio2-bridge.c create mode 100644 drivers/media/pci/intel/ipu3/cio2-bridge.h create mode 100644 drivers/media/pci/intel/ipu3/int3472.c create mode 100644 drivers/media/pci/intel/ipu3/int3472.h rename drivers/media/pci/intel/ipu3/{ipu3-cio2.c => ipu3-cio2-main.c} (98%) -- 2.25.1