From patchwork Tue Oct 24 08:56:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1854243 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SF5Yj2hB1z23jl for ; Tue, 24 Oct 2023 19:58:01 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qvDEZ-0005Wq-2U; Tue, 24 Oct 2023 08:57:55 +0000 Received: from mail-pf1-f169.google.com ([209.85.210.169]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qvDEL-0005VZ-1O for kernel-team@lists.ubuntu.com; Tue, 24 Oct 2023 08:57:41 +0000 Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6be0277c05bso3293029b3a.0 for ; Tue, 24 Oct 2023 01:57:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698137859; x=1698742659; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j3QQulS1WRT+XSFefw8emaybDDKrv2NbIIqNebEuXxI=; b=pWlq/AN9gnRmsPWJgnhqvCdyPbHwQ90JrhJ9gf8T2jc+wLdQLybwFkmZnncCwPd2gx c6XdScvD++JmxqthcqVm2F32L+6b/a1Z8YDVcR++pZKMVjk2NTvGPLe58bzIsshdH4PS p/oXkre4bC/GdYRXZ5kid+Z8RQjwwIUl+fO8AaZ4IQJuWqqmADqWQDYLdiSBg/E7Yn1q nvPQCazqbNHaBav8r9/P4URdIi9nvi4Y17ktZsTzSxBh4rvOMYzrmbz2y1yDBFhnGGsk 6Lil+NUq/FOKqXYS+IwGzVCpqj3b5wslxb9lk8W5w8Gv5UPqZJ7/NtrIwWT+sJJJdcIB geZA== X-Gm-Message-State: AOJu0YwzTY0Mz96PuNnYjpu4drUXbAoRaluePXsxfqCtP9Ykk0l0P7/m NOW8J8wW1QDuMiFz5SOMm3/sscu1ydw= X-Google-Smtp-Source: AGHT+IET8MfJ3g0PEE4rXHKUtwigTgDhuRRr7euvphViT+ZfiZI+ltI0I1Y3xREvfBModPA8DKWX+Q== X-Received: by 2002:a05:6a00:1302:b0:693:3f7a:eec2 with SMTP id j2-20020a056a00130200b006933f7aeec2mr10141883pfu.29.1698137858955; Tue, 24 Oct 2023 01:57:38 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id c15-20020aa7952f000000b006934e7ceb79sm7247825pfp.32.2023.10.24.01.57.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 01:57:38 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2][SRU][Unstable/Mantic] UBUNTU: SAUCE: platform/x86: int3472: Add handshake GPIO function Date: Tue, 24 Oct 2023 16:56:53 +0800 Message-Id: <20231024085653.4076574-3-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231024085653.4076574-1-vicamo.yang@canonical.com> References: <20231024085653.4076574-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.169; envelope-from=vicamo@gmail.com; helo=mail-pf1-f169.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Hao Yao BugLink: https://bugs.launchpad.net/bugs/2031412 Handshake pin is used for Lattice MIPI aggregator to enable the camera sensor. After pulled up, recommend to wail ~250ms to get everything ready. Signed-off-by: Hao Yao Reviewed-by: Andy Shevchenko (cherry-picked from https://lore.kernel.org/all/20231007021225.9240-1-hao.yao@intel.com) Signed-off-by: You-Sheng Yang --- drivers/platform/x86/intel/int3472/common.h | 1 + drivers/platform/x86/intel/int3472/discrete.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/drivers/platform/x86/intel/int3472/common.h b/drivers/platform/x86/intel/int3472/common.h index 9f29baa13860..b009ae3aa62f 100644 --- a/drivers/platform/x86/intel/int3472/common.h +++ b/drivers/platform/x86/intel/int3472/common.h @@ -22,6 +22,7 @@ #define INT3472_GPIO_TYPE_POWER_ENABLE 0x0b #define INT3472_GPIO_TYPE_CLK_ENABLE 0x0c #define INT3472_GPIO_TYPE_PRIVACY_LED 0x0d +#define INT3472_GPIO_TYPE_HANDSHAKE 0x12 #define INT3472_PDEV_MAX_NAME_LEN 23 #define INT3472_MAX_SENSOR_GPIOS 3 diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c index e33c2d75975c..d2b470caea1a 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -110,6 +110,10 @@ static void int3472_get_func_and_polarity(u8 type, const char **func, u32 *polar *func = "power-enable"; *polarity = GPIO_ACTIVE_HIGH; break; + case INT3472_GPIO_TYPE_HANDSHAKE: + *func = "handshake"; + *polarity = GPIO_ACTIVE_HIGH; + break; default: *func = "unknown"; *polarity = GPIO_ACTIVE_HIGH; @@ -200,6 +204,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, switch (type) { case INT3472_GPIO_TYPE_RESET: case INT3472_GPIO_TYPE_POWERDOWN: + case INT3472_GPIO_TYPE_HANDSHAKE: ret = skl_int3472_map_gpio_to_sensor(int3472, agpio, func, polarity); if (ret) err_msg = "Failed to map GPIO pin to sensor\n";