Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp824833lqj; Mon, 3 Jun 2024 01:40:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWUtzrRMrbW2iY1F5d4sc48Gmav5ApSzJE2cmq3XSJbvgJ7cDtarB1ABs1rKHG2f0OctuIthZfgeChiDsVXvElu9XTQefN1E6AKgdZC2A== X-Google-Smtp-Source: AGHT+IFcyeTuEAyKqZ8MsZV3O/Nt/UOWScDUo6EYGTVfKBP8jovEctpU4YOLljqCzVM+HKCA+GMk X-Received: by 2002:a05:6e02:154d:b0:374:95e3:a196 with SMTP id e9e14a558f8ab-37495e3c05emr56507475ab.8.1717404048556; Mon, 03 Jun 2024 01:40:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717404048; cv=pass; d=google.com; s=arc-20160816; b=Z5hTELWd5a1Ck1s51JUroz2qJRHCuhobn/fDV9z73fwYtQ53pK1BZ9ufpuBhSrjhQ8 eSg2xrFEKRhy/26DIt9Q1rvwa4xa120CZNGhQmE9Eo3R/cOD9XqZdLec0S2Gl+/5cFdJ fUH9Nz3gRA5bIRkYC+lWCaO6qVL5XsszdtPYQqDBcGJ18/2TXRsfudvRCumHsuj3DZWI evA37gCSRscLKdXJ5g0GSWP/JVOrk2IVqn0xTfdgT48nHixhwy7hraS4NGJJpF04N5Ft MLx9F7FVXbrcpnqTPTFTvhB8TVfyXfNQHoa7hyrLtfaTj7ldbvVV54PnjWKeuoiW1h1n rr6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=FvTv0UUCUSa1ZKHUBhrFYAND7vgH3Rp2IDvUAdHC24A=; fh=N4RHPXlnzazHW8ZQVyhmBqXmnWLbsyrOsom4ND2phnI=; b=PydkkgLrn6T6ebRoOKVPpWR0XbAzHR1jqqNGYSLBjhYtx1OnhaBzNMpix5ZeIQrnvC JfVDbY8Qh9neadBbp9tpoEK33cZ+WMlTSl51z7ICsLijcW7H+VNt5WcRYtoXhfftvcxz KImKGFw9Uasg/PcLBbkW99bd06kVsnh5IL9J2sxguOg724kV+SAf187w4OJd056A9Yjp lrKqayDef0A0Fg3tpqMcuHGHv5Z1fhAye6WGOebHlVqawTHxByRPH3RzlKp7WLOk9G0p U4K1yusviK76KZLe6Y3soEPTp49AbUzwYgyQ6wZIm+GAQEsRBoKBVZvOG3cMlDj4R2Vv jtCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@dolcini.it header.s=default header.b=z7L+3c+Z; arc=pass (i=1 spf=pass spfdomain=dolcini.it dkim=pass dkdomain=dolcini.it dmarc=pass fromdomain=dolcini.it); spf=pass (google.com: domain of linux-kernel+bounces-198791-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198791-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dolcini.it Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35b222bd2si6424766a12.467.2024.06.03.01.40.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 01:40:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198791-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@dolcini.it header.s=default header.b=z7L+3c+Z; arc=pass (i=1 spf=pass spfdomain=dolcini.it dkim=pass dkdomain=dolcini.it dmarc=pass fromdomain=dolcini.it); spf=pass (google.com: domain of linux-kernel+bounces-198791-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198791-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dolcini.it Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 878E1B22226 for ; Mon, 3 Jun 2024 08:36:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E51207442F; Mon, 3 Jun 2024 08:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dolcini.it header.i=@dolcini.it header.b="z7L+3c+Z" Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE69C5B5D3; Mon, 3 Jun 2024 08:36:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.194.8.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717403784; cv=none; b=dnsPGcTGnFyK96xndrQ/+E6je+21I6efaPbZuUAliRiQhST/P32Qiu4/nWRrMyS7YHbQ2f0AK9gwk8a4u54nenMpNY1Or2lE2qBasFsbRml0liqmuTec3VL6SKsthEtqCXIUsoABB0Chxr8LdQULk78bkJZY2ViNxT62xXqf9Lg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717403784; c=relaxed/simple; bh=SjSnyJI/iMOQgwnrgExy7VarJd7DNOzblUnaTzUdmOo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IH8ifG58sn95szchzaDqt6MM17Ygteb4O2ivVmgimZpyU9MSX29dWvYfUw2Nf04XRpUOvb7DqtFBxS2mVgUe6RMtfoIkJn3V2CnuIVD7d8CrsMiOZjNUnsbXLnn+MZQYb8h5PjcnfTbYWHLdvKxW3Jx0FhjHRGJrPBhNyh9TUeg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dolcini.it; spf=pass smtp.mailfrom=dolcini.it; dkim=pass (2048-bit key) header.d=dolcini.it header.i=@dolcini.it header.b=z7L+3c+Z; arc=none smtp.client-ip=217.194.8.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dolcini.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dolcini.it Received: from francesco-nb.pivistrello.it (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id 324531FA0A; Mon, 3 Jun 2024 10:36:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dolcini.it; s=default; t=1717403773; bh=FvTv0UUCUSa1ZKHUBhrFYAND7vgH3Rp2IDvUAdHC24A=; h=From:To:Subject; b=z7L+3c+Z9u/PkRfVuGZLUkBKXzzdDABDCTJeQqijXnxHptNkSBaPbGRNlfgubJT0N oWc+XqQK/dhTDmoCd6mMPdPqGFGZEAERIc4k5QdRm1kh3/qpBCFJFFRBMJSDkKBYGP w36p15bGGt9XwXqtu/xmKk+TLfpK4xnnPm/Z531j6QGlcV3CFXyVPQiduP5Yjtg1Ym Av2KTbAQvZFbzcrgC1UGWS1UTsjULuMKzSGlkFouHeHkO5iKDUgUJm99RJa7hXex6+ wCSreLzJM5lyisF36GsFvQKWJ8nkAdp6ruJ2EdCFcBfL0ZsdmLmfBe6h8yYEYSnP+E j/U/nC/Fcfy4w== From: Francesco Dolcini To: Heikki Krogerus , Greg Kroah-Hartman Cc: Francesco Dolcini , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Baryshkov , Bjorn Andersson Subject: [PATCH v2 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional Date: Mon, 3 Jun 2024 10:35:58 +0200 Message-Id: <20240603083558.9629-3-francesco@dolcini.it> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240603083558.9629-1-francesco@dolcini.it> References: <20240603083558.9629-1-francesco@dolcini.it> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Francesco Dolcini The enable gpio is not required when the SBU mux is used only for orientation, make it optional. Signed-off-by: Francesco Dolcini --- v2: - removed useless NULL check for optional enable gpio --- drivers/usb/typec/mux/gpio-sbu-mux.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c index 374168482d36..8902102c05a8 100644 --- a/drivers/usb/typec/mux/gpio-sbu-mux.c +++ b/drivers/usb/typec/mux/gpio-sbu-mux.c @@ -66,6 +66,9 @@ static int gpio_sbu_mux_set(struct typec_mux_dev *mux, { struct gpio_sbu_mux *sbu_mux = typec_mux_get_drvdata(mux); + if (!sbu_mux->enable_gpio) + return -EOPNOTSUPP; + mutex_lock(&sbu_mux->lock); switch (state->mode) { @@ -102,7 +105,8 @@ static int gpio_sbu_mux_probe(struct platform_device *pdev) mutex_init(&sbu_mux->lock); - sbu_mux->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); + sbu_mux->enable_gpio = devm_gpiod_get_optional(dev, "enable", + GPIOD_OUT_LOW); if (IS_ERR(sbu_mux->enable_gpio)) return dev_err_probe(dev, PTR_ERR(sbu_mux->enable_gpio), "unable to acquire enable gpio\n"); -- 2.39.2