Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4537104imj; Tue, 12 Feb 2019 18:49:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IZbNcfPPaCS7nDFODyZWFVRaFCrQHdz3URVotqFaEQ30K863AglNvGVMyQpX2Pg/bAKcx73 X-Received: by 2002:a17:902:7204:: with SMTP id ba4mr7443096plb.186.1550026152944; Tue, 12 Feb 2019 18:49:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550026152; cv=none; d=google.com; s=arc-20160816; b=crnsSb4qdThHtmjqXVvAUoXRm6qPbfzkS+BW+NRPZphHlSIc9whNDE8vTKGCOEYtdC hVUJel4A0TpzmuZTOHjZ8rz7XWP0z9i4LiRUNqYBJFK7ZhUQzVeeKeHKV5Ry16yBpGwK d5q6LAAl8zkfrQNpswxRJGzM9lzF/Vqhk1khHmPejm5BBPy7KdcgJLFg6eUjm7zibf51 u+L/JkBLGQPqy4xaGr5dKFN+Gjey+jN53/fIZLTO4cM1jqWrKvZyhtnZ9aFaI9YCciPa 7SFwVIcYi0Fa1rRRWs1xMOrC6BM2ezyHLkE/yC8MZ3CHnj5zswktLAWVOhG9qqll/Y+k NuwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject:autocrypt :content-transfer-encoding:mime-version:references:in-reply-to:date :dkim-signature; bh=n+0HFoSYnepK9yEAZMuZMDxMr2ODy5Uu9899vA8XEHs=; b=tavk/ftIvIv2CjppiAEkzqQEx9GStS3LjB2ctQCffZ4648E662lJBn65wtNPOViOmO H6LzwIi4vtOXXxvC/yhSaoM44YU1pi0YqnL61x/y8DO+LLsc/OE40rvmGtkXNUIDlg5v nA+qH5wcZ+V//EWkyozYGlRfyx2diEvT6LZeU7df0JcvK7nrDU2hn5cJkjeq/vgP5rye UHxIULSfJDaZ6150s8IU4XXaomE32nOOlUhtEpnCSAKaR3SNRGztBFjPbPKevKQThGSf VXNTZyY6PwWkfoE3wmilW19lINGm5ory9RkXCD1cUP/DivbyVPK1iD9h9W6hDJwZPVT/ MY7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ttUVBGtw; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si14340353plr.355.2019.02.12.18.48.51; Tue, 12 Feb 2019 18:49:12 -0800 (PST) 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=fail header.i=@gmail.com header.s=20161025 header.b=ttUVBGtw; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389755AbfBMCr4 (ORCPT + 99 others); Tue, 12 Feb 2019 21:47:56 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:33962 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388986AbfBMCrx (ORCPT ); Tue, 12 Feb 2019 21:47:53 -0500 Received: by mail-ot1-f67.google.com with SMTP id 98so1554421oty.1; Tue, 12 Feb 2019 18:47:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:in-reply-to:references:mime-version:content-transfer-encoding :autocrypt:subject:to:cc:from:message-id; bh=n+0HFoSYnepK9yEAZMuZMDxMr2ODy5Uu9899vA8XEHs=; b=ttUVBGtwjnF8xDpIQ8QowrX0RQY9zvmb2HyItbsj75P3R2BrZpw2vcjZSyWbitXR+M Y5rWFWfcPxq3ZelRXyhvUz8bBq5lznUcAu+rjuR+mcs73YGoqJh3WxPeJGFaBtdCFe7X 3563sTMfA+62DrVzJoV2zGp6Z57dM/x0QFbe8m+n7Qt2BYKxCoG2ivjqMHicAZhDyT/w Vkuxag6w2QJIs7Vlz3LAHcyCkzlxOQ1/mgTMYVJ6oo/v7JaTHHM8Gmkizm+ce50XhQU3 SEq5IGpIQJ9WSSc+6tEHCmHwoGUTE7Q7jE8FSGPaueX3dfdFhS3RGusdIDVfsFVS+TV9 ES5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:references:mime-version :content-transfer-encoding:autocrypt:subject:to:cc:from:message-id; bh=n+0HFoSYnepK9yEAZMuZMDxMr2ODy5Uu9899vA8XEHs=; b=CNf0N4Wf+4gXiknmY9a4Mtm/09MqjgRPhse/bjN2VJdvCcEikgklx0TeqNAG3g7iTk lwu7O1AAD4NXxivsstwF7QBZAGIFM3YorgubfOsygR8hY5LSbHf1N7t5Fi50weX0LOuE 8EX91Dw8L7laoTb75w7fttHr1kz/oq/r/WusDzCktPi8WskGBk1sZJ8rJk8rhFIaL772 v66a/yiIXOKrUISLtd6kn5kxcwoS1kIJy7YvQqSZMUSbdOgh32d6NZReTiqy/luobvFG GpvTAspunS4ZoJRIrzGOu7b1bapzmuh5K+Um1K0Um4h2C9FkmuWreVaGd7m+v9MIaDqn uAxw== X-Gm-Message-State: AHQUAuZUs24CZdHmv7ITbpza/V+JFqNGz3D/OHqRNsFbZ9yl7S7ExZ4u +g+74g/PK7mSK4BZhw7aK30= X-Received: by 2002:a9d:7e87:: with SMTP id m7mr7567375otp.225.1550026072524; Tue, 12 Feb 2019 18:47:52 -0800 (PST) Received: from localhost (ip68-228-73-187.oc.oc.cox.net. [68.228.73.187]) by smtp.gmail.com with ESMTPSA id k25sm3228825oic.27.2019.02.12.18.47.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 18:47:51 -0800 (PST) Date: Tue, 12 Feb 2019 18:47:44 -0800 In-Reply-To: <1550021937-12202-1-git-send-email-justinpopo6@gmail.com> References: <1550021937-12202-1-git-send-email-justinpopo6@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Autocrypt: addr=f.fainelli@gmail.com; keydata= mQGiBEjPuBIRBACW9MxSJU9fvEOCTnRNqG/13rAGsj+vJqontvoDSNxRgmafP8d3nesnqPyRxGlk aOSDuu09rxuW+69Y2f1TzjFuGpBk4ysWOR85O2Nx8AJ6fYGCoeTbovrNlGT1M9obSFGQX3IzRnWo qlfudjTO5TKoqkbOgpYqIo5n1QbEjCCwCwCg3DOH/4ug2AUUlcIT9/l3pGvoRJ0EAICDzi3l7pmC 5IWn2n1mvP5247urtHFs/uusE827DDj3K8Upn2vYiOFMBhGsxAk6YKV6IP0dZdWX6fqkJJlu9cSD vWtO1hXeHIfQIE/xcqvlRH783KrihLcsmnBqOiS6rJDO2x1eAgC8meAXSAgsrBhcgGl2Rl5gh/jk eA5ykwbxA/9u1eEuL70Qzt5APJmqVXR+kWvrqdBVPoUNy/tQ8mYcnzJJ63ng3tHhnwHXZOu8hL4n qwlYHRa9eeglXYhBqja4ZvIvCEqSmEukfivk+DlIgVoOAJbhqIWgvr3SIEuR6ayY3f5j0f2ejUMY lYYnKdiHXFlF9uXm1ELrb0YX4GMHz7QnRmxvcmlhbiBGYWluZWxsaSA8Zi5mYWluZWxsaUBnbWFp bC5jb20+iGYEExECACYCGyMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAUCVF/S8QUJHlwd3wAKCRBh V5kVtWN2DvCVAJ4u4/bPF4P3jxb4qEY8I2gS6hG0gACffNWlqJ2T4wSSn+3o7CCZNd7SLSC5BA0E SM+4EhA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3e1542lh3/mpiGSilCsaTahEGrHK+lIusl6mzJoil+u3k01ofvJMK0ZdzGUZ/aPMZ 16LofjFA+MNxWrZFrkYmiGdv+LG45zSlZyIvzSiG2lKykuVag+IijCIom78P9jRtB1q1Q5lwZp2T LAJlz92DmFwBg1hyFzwDADjZ2nrDxKUiybXIgZp9aU2d++ptEGCVJOfEW4qpWCCLPbOT7XBr+g/4 H3qWbs3j/cDDq7LuVYIe+wchy/iXEJaQVeTCy5arMQorqTFWlEOgRA8OP47L9knl9i4xuR0euV6D ChDrguup2aJVU4hPBBgRAgAPAhsMBQJUX9LxBQkeXB3fAAoJEGFXmRW1Y3YOj4UAn3nrFLPZekMe qX5aD/aq/dsbXSfyAKC45Go0YyxVHGuUuzv+GKZ6nsysJw== Subject: Re: [PATCH v2] iio: adc: ti-ads7950: add GPIO support To: justinpopo6@gmail.com, linux-iio@vger.kernel.org CC: linux-gpio@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, bgolaszewski@baylibre.com, linus.walleij@linaro.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, david@lechnology.com, linux-kernel@vger.kernel.org, jic23@kernel.org, Justin Chen From: Florian Fainelli Message-ID: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Justin, This looks good, one comment below: [snip] >+static int ti_ads7950_init_gpio(struct ti_ads7950_state *st) >+{ >+ int ret; >+ >+ /* Initialize GPIO */ >+ mutex_lock(&st->slock); Lock is acquired here=2E >+ >+ /* Default to GPIO input */ >+ st->gpio_direction_bitmask =3D 0x0; >+ st->single_tx =3D cpu_to_be16(TI_ADS7950_CR_GPIO | >+ (st->gpio_direction_bitmask & >+ TI_ADS7950_GPIO_MASK)); >+ ret =3D spi_sync(st->spi, &st->scan_single_msg); >+ mutex_unlock(&st->slock); then released here=2E >+ if (ret) >+ return ret; >+ >+ /* Default to signal low */ >+ st->gpio_signal_bitmask =3D 0x0; >+ st->single_tx =3D cpu_to_be16(TI_ADS7950_CR_MANUAL | >+ TI_ADS7950_CR_WRITE | >+ (st->gpio_signal_bitmask & >+ TI_ADS7950_GPIO_MASK)); >+ ret =3D spi_sync(st->spi, &st->scan_single_msg); >+ mutex_unlock(&st->slock); and here as well, presumably there should be a mutex_lock() guarding the s= ignal bitmask and transaction, right? Thanks! --=20 Florian