From nobody Thu Jan 20 10:24:09 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BE02019700A3; Thu, 20 Jan 2022 10:24:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JfdsR3JQsz4dxS; Thu, 20 Jan 2022 10:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642674251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QwZNZGAj950FCtr9c7hDw4Wrg7HJa60fVTPyYtaaSk4=; b=K1Ap/3fo34bqom/MdhSbc9L1TybCcipFoJVaMJ94xMFQzQyUNQ0XxyoAgoGWmYdaZ5Tr4u etnaAZB7ErhFTmvvwiDu3tgh53Z73QzxT9iIxJCN0+GszabvOEhOYICl3ig5gDCBSpi/2O wAa1so3YZqaSIe7xea3Xh2AZ2File3i8Ui9zqW25LH4OgW8a1wdKgK42gEa0YjTeArA/O6 jW3S8dQywcwt5caRuuaHahpbpScm7OENj+kLtO4D/LaOwiGBH15Epqj9rizho2i1v3ObER mKYSpDPyKgtAd9rkTkeX4ZMSbV82wnaOtv33xPzK4G0sRlXgIEXGJk87DB0dEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A46F26A11; Thu, 20 Jan 2022 10:24:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20KAO9nb018305; Thu, 20 Jan 2022 10:24:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20KAO9a4018304; Thu, 20 Jan 2022 10:24:09 GMT (envelope-from git) Date: Thu, 20 Jan 2022 10:24:09 GMT Message-Id: <202201201024.20KAO9a4018304@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michal Meloun Subject: git: 40a0633862cd - stable/13 - mvebu_gpio: Fix settings of gpio pin direction. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 40a0633862cd2eae3272f10be96e36f48e3af030 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642674251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QwZNZGAj950FCtr9c7hDw4Wrg7HJa60fVTPyYtaaSk4=; b=b8lA+JVlEWJwOfH6BM8LqixINMbn3O+YhGP/JsICH0lUMsx/fsazKw5BSNIKTfIHDg3OHx cBF27KuNs5U2xIfja5y3//Xo3hRd/8iAvcpFI5EnOPMYEisUrs9D9vhMESadDZ0N2sroJQ AvK2QlmfuZpN7+IwpV04ZZzD0G5v81UcZ9V8wHbf9zcdDJQ454j9i+cUpmQ9ai+DqM0X3s nySO3SHllt6keWdK/SpI153k7XbC3367JwsLM5O23w4aKuAm2b6sZ9tw6D4Rbuh1WtQSQq iPFpthjqhunCsMuI3Ej0S0CHjF3Afl3UW0aUKJZ7r4MAzRQwZv1qn8NfNAJQGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642674251; a=rsa-sha256; cv=none; b=o4rgOiP+VbBQXNzaok4qNkYYG6W6eDfNq8z1QeFPyQrUeHFrKDs2pdgWVy6CX8lucpHj+x 7/qnv1eEcIvLj8eXistfE2AX2cW+FFnOaRIjq3sWZ7Kbv2XwKjN0V+R7hhEVKUHavPbWtR 8zB+1FDjXu8Bzv34oViyEVJzg4qI48gcIMjzkjlsmkkY9BE7Ql/d00AOBWZNoZ0zVCia1J EPq1X4gnKYk5PvTdiw2L2WeXemEf+ygTCJeTiTbcPz6s2CfoYQMhKThK0tH9zbzJybGXP7 wrq5DoeMpMm5dD2l2w9nXgYZVQr8d1WYD/DLQ/wPYRQAyg70bsPiNbfoIVp6og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=40a0633862cd2eae3272f10be96e36f48e3af030 commit 40a0633862cd2eae3272f10be96e36f48e3af030 Author: Michal Meloun AuthorDate: 2021-03-07 08:50:57 +0000 Commit: Michal Meloun CommitDate: 2022-01-20 10:22:30 +0000 mvebu_gpio: Fix settings of gpio pin direction. Data Output Enable Control register is inverted – 0 means output direction. Reflect this fact in code. MFC after: 3 weeks (cherry picked from commit 01c6d7918985c6e8610d6245af0f745ced86ffd5) --- sys/arm/mv/mvebu_gpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arm/mv/mvebu_gpio.c b/sys/arm/mv/mvebu_gpio.c index c38fbceebf24..21766f57c9b6 100644 --- a/sys/arm/mv/mvebu_gpio.c +++ b/sys/arm/mv/mvebu_gpio.c @@ -167,10 +167,10 @@ mvebu_gpio_pin_configure(struct mvebu_gpio_softc *sc, struct gpio_pin *pin, pin->gp_flags &= ~(GPIO_PIN_INPUT | GPIO_PIN_OUTPUT); if (flags & GPIO_PIN_OUTPUT) { pin->gp_flags |= GPIO_PIN_OUTPUT; - gpio_write(sc, GPIO_CONTROL_SET, pin, 1); + gpio_write(sc, GPIO_CONTROL_CLR, pin, 1); } else { pin->gp_flags |= GPIO_PIN_INPUT; - gpio_write(sc, GPIO_CONTROL_CLR, pin, 1); + gpio_write(sc, GPIO_CONTROL_SET, pin, 1); } } @@ -785,7 +785,7 @@ mvebu_gpio_attach(device_t dev) else pin->gp_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; pin->gp_flags = - gpio_read(sc, GPIO_CONTROL, &sc->gpio_pins[i]) != 0 ? + gpio_read(sc, GPIO_CONTROL, &sc->gpio_pins[i]) == 0 ? GPIO_PIN_OUTPUT : GPIO_PIN_INPUT; snprintf(pin->gp_name, GPIOMAXNAME, "gpio%d", i);