Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp763422lqp; Thu, 21 Mar 2024 15:06:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXgweO3cWUaP0gJiWyLIlMBhgtGBLZRBYd+87CwHONPbsMTV4tt9QxZePt/a2sOFFQTRPqgbPuUBTM5tozCFIAD/XFrHtqTrfyLp2NHvQ== X-Google-Smtp-Source: AGHT+IF7kNXA1dcuFexdyYin+6oyyH4R7UY+uk7exzqrY7IV8VGR8MOeRIHzcaldptjARubx8yIn X-Received: by 2002:a17:902:f544:b0:1e0:20b4:6bc8 with SMTP id h4-20020a170902f54400b001e020b46bc8mr991124plf.15.1711058782494; Thu, 21 Mar 2024 15:06:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711058782; cv=pass; d=google.com; s=arc-20160816; b=ct31NvLl8dF1V18DCoxV3wN2eqPuAZrIEa2t0ygLI+TmNsfTmJxwX4PVmsRQr7AVZ0 M5elK3Er1OViV3uXtY8BR7BUHatH5cBAIOalq3ICnCVQkioNVVo5C4dOhZulsiP39NW4 s4St+cE+TFqnwrPgY3fm/8q16WghLhPeGNx/i2DG61porNMSiJLYQ8fUrjGLF3kks104 dbh9wDeFlPQiUI8dfDFfPFluIKysCZR/IqUwAvR3v9jYofUCp0NRC39b8z/POQmmZuJr hssjukuUIsUbxX3sYqPuNGcqpY1gujxqLoELC3CHcOedNRXakecyCYhdeGiIKzIW/W+4 xJ3g== 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:dkim-filter; bh=//jzrul5/etI5HJYv4rf3hRGSryC23BhON2Tv1y72Hc=; fh=X4QAQfkJoHBoTjypDfqSMHAFutuwOQvRiEbCzpU4yFA=; b=ur9yJg4rO496wY3gVoT6FlZ/Bs6iYZxDmZOZcdBSZvcJwjldm71BEL6+vvodofXXMn m/o+1iT6ijwE0h3qf4TOGHHplgcWpOHCNysMOWuEjIkg9HFQuB4iJS7ylV/jtZcBXjB2 ROnl769IZjJmodRASYDG0MEtAizPmez6FKL+2e4i7cD1SQ2JsF6D6kbwxna/b9qYO+f1 EGfZYSiLHeiuIyUIyCrVlnNGADvHbnBKG2nMuv3l+Cj5GfkWNEmQhSk06shjlTtfQrrF mVcJvQfVoxedgitVBjnUq5cheVatqeOffa5aPvit04Cql/AI6ZS3HEirDT/g3o2FIJgO lr5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=T5uniTGB; arc=pass (i=1 spf=pass spfdomain=savoirfairelinux.com dkim=pass dkdomain=savoirfairelinux.com); spf=pass (google.com: domain of linux-kernel+bounces-110721-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110721-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m17-20020a170902f65100b001dedfba7897si572902plg.97.2024.03.21.15.06.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 15:06:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110721-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=T5uniTGB; arc=pass (i=1 spf=pass spfdomain=savoirfairelinux.com dkim=pass dkdomain=savoirfairelinux.com); spf=pass (google.com: domain of linux-kernel+bounces-110721-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110721-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EF0B4286D15 for ; Thu, 21 Mar 2024 22:06:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2EB613666C; Thu, 21 Mar 2024 22:06:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b="T5uniTGB" Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40FC4133998; Thu, 21 Mar 2024 22:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=208.88.110.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711058774; cv=none; b=anffCRPGdEg61SPxTy5QzrxTg364SsMg6YNBBjLnOkhfceBq67oOQZuLyt12uCJhX5M2TBKDJdGL/ulVUXJE470HH0L/0exVuq8kerZ4TfS5YrWhWUHPCQ63zi41EhzilHW8sp7bshCvQJH8m/bJun86ojqnqi+mOXaMdwDUmss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711058774; c=relaxed/simple; bh=TIQnoZwJq4qDV5cDowLeR4WsNNtBuDa7FQIqcE3Y5wM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hpy65wh6h4MYyApgQeLOcQDZ8Ptz5sGUCStrxGHnSJaTdfkKuP4fOzJk4CpbvbjhxgU+taZjUMK08xpzdc8XQF0bPeXwNNvRnyL+oFeMzgMK3cFa5PEA/zbO6s/GDikucP2g5dB9WdqXJtRF8pM/E4y6NbqyxxKgv7IoeUqhGk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com; spf=pass smtp.mailfrom=savoirfairelinux.com; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b=T5uniTGB; arc=none smtp.client-ip=208.88.110.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=savoirfairelinux.com Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 096639C5431; Thu, 21 Mar 2024 18:06:11 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id MV2G5OsxunWi; Thu, 21 Mar 2024 18:06:10 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 5CB399C5485; Thu, 21 Mar 2024 18:06:10 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 5CB399C5485 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1711058770; bh=//jzrul5/etI5HJYv4rf3hRGSryC23BhON2Tv1y72Hc=; h=From:To:Date:Message-ID:MIME-Version; b=T5uniTGBmvD8LX14fBd2OlCRPvba5J3pH1vN0P9VlkNjSgE40kuovUZ27K0X9vPMn e1fAvNB24jTKTgskz7fQCj1PvqdO3DpfYG52PuFSMPUnux/r0JXWMg+SNXNSzdx0x5 ePQScX9L8vlWCgNz891db+MEXYLlxN8Qt8B5GXz0GwK3UiDuzCQ8JedKJZVaqAYfv/ 0Cd+DtdmlG1BjeIiv9Mf6WbyDZ5eyypCB5RbENlG86Tkrclf6G9BHIShLosqrQgn8F nx/osgfLH91TFIo2HJ8OGCB9nloSWtSnN2Xuhb2TpKy7dPNvJ0KmRCgUrnGqgU5WXK iFAjlu1JFKPIw== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id Jg8QBSn7EGNf; Thu, 21 Mar 2024 18:06:10 -0400 (EDT) Received: from pcperry.mtl.sfl (unknown [192.168.51.254]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 33CD79C5431; Thu, 21 Mar 2024 18:06:10 -0400 (EDT) From: Charles Perry To: mdf@kernel.org Cc: avandiver@markem-imaje.com, bcody@markem-imaje.com, Charles Perry , Wu Hao , Xu Yilun , Tom Rix , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michal Simek , linux-fpga@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 4/4] fpga: xilinx-core: add new gpio names for prog and init Date: Thu, 21 Mar 2024 18:04:36 -0400 Message-ID: <20240321220447.3260065-5-charles.perry@savoirfairelinux.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240321220447.3260065-1-charles.perry@savoirfairelinux.com> References: <20240321220447.3260065-1-charles.perry@savoirfairelinux.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Old names (prog_b and init-b) are used as a fallback for hardware compatible with the "xlnx,fpga-slave-serial" string. Signed-off-by: Charles Perry --- drivers/fpga/xilinx-core.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/fpga/xilinx-core.c b/drivers/fpga/xilinx-core.c index a35c43382dd5f..39aeacf2e4f17 100644 --- a/drivers/fpga/xilinx-core.c +++ b/drivers/fpga/xilinx-core.c @@ -171,6 +171,20 @@ static int xilinx_core_write_complete(struct fpga_ma= nager *mgr, return -ETIMEDOUT; } +static inline struct gpio_desc * +xilinx_core_devm_gpiod_get(struct device *dev, const char *con_id, + const char *legacy_con_id, enum gpiod_flags flags) +{ + struct gpio_desc *desc; + + desc =3D devm_gpiod_get(dev, con_id, flags); + if (IS_ERR(desc) && PTR_ERR(desc) =3D=3D -ENOENT && + of_device_is_compatible(dev->of_node, "xlnx,fpga-slave-serial")) + desc =3D devm_gpiod_get(dev, legacy_con_id, flags); + + return desc; +} + static const struct fpga_manager_ops xilinx_core_ops =3D { .state =3D xilinx_core_state, .write_init =3D xilinx_core_write_init, @@ -186,12 +200,14 @@ int xilinx_core_probe(struct xilinx_fpga_core *core= ) return -EINVAL; /* PROGRAM_B is active low */ - core->prog_b =3D devm_gpiod_get(core->dev, "prog_b", GPIOD_OUT_LOW); + core->prog_b =3D xilinx_core_devm_gpiod_get(core->dev, "prog", "prog_b"= , + GPIOD_OUT_LOW); if (IS_ERR(core->prog_b)) return dev_err_probe(core->dev, PTR_ERR(core->prog_b), "Failed to get PROGRAM_B gpio\n"); - core->init_b =3D devm_gpiod_get_optional(core->dev, "init-b", GPIOD_IN)= ; + core->init_b =3D xilinx_core_devm_gpiod_get(core->dev, "init", "init-b"= , + GPIOD_IN); if (IS_ERR(core->init_b)) return dev_err_probe(core->dev, PTR_ERR(core->init_b), "Failed to get INIT_B gpio\n"); -- 2.43.0