Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp892752imm; Fri, 5 Oct 2018 13:45:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV60tAQP6az89RB5TW5FRqRvaB3y7l1hBDirk94TjPa5P9HQmqkUyctf3KJjB/XCxBj62eGSP X-Received: by 2002:a63:4e11:: with SMTP id c17-v6mr11512557pgb.6.1538772313774; Fri, 05 Oct 2018 13:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538772313; cv=none; d=google.com; s=arc-20160816; b=ILzNBTqGpBJ+ZKUjLR4UASevehNhtpRT0FFcADh8hyfMFPxKRW8VNqSUyqSoWOAzDN zKAQ3QFSeeEK0lmUirjLJeAtIwN6YNTWMWQuwh6ffRMJfsqt2ZOtljXaJv24blsgqMgu m7/PrjM/fSn4k+EYhOfgUY502+N2HMR16OkL8bJyFma/k8vd09YvgGjhGupOc581gIqz Pqt8fHlwlIA1ofl2wmdggjrmOqYwsjkibyws65wQmwkXucfceEkjUreA9Sp3lbg9Pmz0 Zm1/TmUsMDWB0CdIA5AU9xJBI4VRctGokxNIfJExCKIk1LaHEs8VoCdc/Q6wNJ/kfW7w rETg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Kd1q3UKtpKnExK556Lbqrtv0MeHJ+ayiKXHQ6lioDG4=; b=bWw4UZGG87N/ga1ex5+426epLv3jbU/UPc3lTiknh8a4Uk3xh7DIJHCC2eiKZ9xU3p ksH27rMIGPT8512pGwtPt4o0hnVjbN+SnVNdi6tCn4CQqTkk9aMdxyHz1iUynG+hMvX2 GKvZegg5V7CXGnKc3SlLspbDNWklgdPvWuujz1gVBFXLOgcWmGYeVqJ82qWUJgZ/cVYS EvMppjeCiqOujANzVWTcpCkAJpBx1WmFFgQbPptPkzMjs8SNxA/HPQ7bHcX3uPkmLIID sD6LXcMK4xFkf0qY4pgvdMAGog2MZWrZdPbnc5jHLZGkLmkjT2RPTKmeL4n9MgU/E0A7 U9cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EwKpCmay; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s26-v6si9556355pfj.226.2018.10.05.13.44.58; Fri, 05 Oct 2018 13:45:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EwKpCmay; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729070AbeJFDpI (ORCPT + 99 others); Fri, 5 Oct 2018 23:45:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:38488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728293AbeJFDpI (ORCPT ); Fri, 5 Oct 2018 23:45:08 -0400 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6CA9321479; Fri, 5 Oct 2018 20:44:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538772284; bh=WgYlrG8hsMysKrQL7wi+5KrUGOyEcBPRh5lkQOS2CM4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=EwKpCmay0er4e9MgcaOxLNPHhLh6IlAiXDLc1Bg8ehSU0oVm/zPfejDaXZg2iYFLn duxPRDWEnSNLw7DebxKS4rwy8+Ln9ITZTV32HXv1DJJP8pvmZ/pZrBQRNUwjARzDV7 1pX10FOUvJ6CXdhJ2Im7uLnLntJdQKgiB36hzdw8= Received: by mail-ot1-f46.google.com with SMTP id k5so1191778ote.3; Fri, 05 Oct 2018 13:44:44 -0700 (PDT) X-Gm-Message-State: ABuFfog5NHl1PSn/q+GtxtpfijqQe1582dQDtdypVh0TP13ZzD0up6kH W3OfldMBzsnf+oKjbxtCyJBxb29+nCR2mU+PCgY= X-Received: by 2002:a9d:28d4:: with SMTP id s78mr7011887ota.38.1538772283747; Fri, 05 Oct 2018 13:44:43 -0700 (PDT) MIME-Version: 1.0 References: <20181005065300.22882-1-ricardo.ribalda@gmail.com> <20181005065300.22882-3-ricardo.ribalda@gmail.com> <8d10f9b4-7ea9-7d27-478a-39982ba49587@codeaurora.org> In-Reply-To: From: Timur Tabi Date: Fri, 5 Oct 2018 15:44:06 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 3/3] gpiolib: Show correct direction from the beginning To: Timur Tabi Cc: Jeffrey Hugo , Ricardo Ribalda Delgado , Linus , Stephen Boyd , linux-gpio , lkml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 5, 2018 at 11:54 AM Timur Tabi wrote: > If you want, just put a printk(... offset) in msm_gpio_get() and read > from a GPIO that you know you have access to, and make sure the > 'offset' is correct. > > Then try reading from a GPIO that you don't have access to, and make > sure you get a failure before msm_gpio_get() is called. Just FYI, if you use sysfs to write to the GPIO, based on the kernel log you pasted, GPIO 362 in sysfs is actually pin 0 in the TLMM. If you use gpio-test, it uses gpiolib which figures this all out for you. There should still be the gpio-test wiki page I wrote that tells you how to use it.