From patchwork Wed Oct 25 16:06:42 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: 1855168 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 4SFv3k4Zgsz23jn for ; Thu, 26 Oct 2023 03:08:18 +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 1qvgQJ-0007pN-Vz; Wed, 25 Oct 2023 16:08:01 +0000 Received: from mail-pl1-f170.google.com ([209.85.214.170]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qvgPq-0007d5-6F for kernel-team@lists.ubuntu.com; Wed, 25 Oct 2023 16:07:30 +0000 Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1ca052ec63bso50915215ad.1 for ; Wed, 25 Oct 2023 09:07:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698250048; x=1698854848; 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=ZWQiPrFG4zMkrd/QZBy0LlOMmjAa+qs3QNzTKMwuFTPjPCDt+/BzceXEWlh5U6ljSz /sokvqjiuGRfLRhFE/AgO+JfeUO6F+qJXjQGvVJFxtOe42SYYfSV2ISFwLGOPz34tpr+ 2E3+eChLUqQGLOd2qgec10WmzNAvMCNoAe6Nw52t3zfsvbZyIUwTkw/JHjE3J9U0NeGr 2Byqe4V3ojLYOzvw9XDQMbda8sbXrAEISDR8YXZ5pu4EpXVKxLCyKovaoNLOWi0oUD+C 338AGqv4EYJSH4HRnlqJrz4dXHP5fQSb7ZXXaxsaEPIPKgP0sQsoZAtucstdLsoWAPUl WxrA== X-Gm-Message-State: AOJu0YyCha6S1Cu6HXq/Em02wLpSxihW2LOTzKzOnNVg5VQwCNC+qHoj tpuWshyTm67F/XG/WcKYPp6tgUuGZ5o= X-Google-Smtp-Source: AGHT+IE95aTrMe/GPUzTx5IuVD+X/yn1gHXIFTcyNqgf0Fe9SkTEKKzxMQ5RduYbfv3jmQmHdHi6tg== X-Received: by 2002:a17:902:ee53:b0:1c0:cbaf:6930 with SMTP id 19-20020a170902ee5300b001c0cbaf6930mr13701345plo.54.1698250047927; Wed, 25 Oct 2023 09:07:27 -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 c12-20020a170902724c00b001ae0152d280sm9311693pll.193.2023.10.25.09.07.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 09:07:27 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH V2 2/2][SRU][Mantic] UBUNTU: SAUCE: platform/x86: int3472: Add handshake GPIO function Date: Thu, 26 Oct 2023 00:06:42 +0800 Message-Id: <20231025160642.4040394-3-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231025160642.4040394-1-vicamo.yang@canonical.com> References: <20231025160642.4040394-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.170; envelope-from=vicamo@gmail.com; helo=mail-pl1-f170.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";