From patchwork Mon May 7 15:56:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 135102 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp3327263lji; Mon, 7 May 2018 08:57:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZokFYfqOmNQTrHnQ9Lv1iG+LfUikUYAjvCtJh+9fT/8QjB+LOquEwGA7Rua1hG8JcF4aF9o X-Received: by 2002:a24:db57:: with SMTP id c84-v6mr1843067itg.60.1525708667409; Mon, 07 May 2018 08:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525708667; cv=none; d=google.com; s=arc-20160816; b=O5KP51CxhJBzcYS6CqrWq3GVArqdtE0R8EK+Mxw9xjFe6rZjlmcJ+CAaHW8rGBv6Bf WhDisEYslEI4ViRoLtqs7BSB9Z3MuoYWqGHxoSTF1y2VAcf8mOEuSN1xK/M6ivxwT2NX 7w8p99EIV12rhfDN0nDAo/nUsuYUah3anfYRMWsmW45X5KTHZLsxxXgPb6YaPfIic9ef vcufl0JVWDmMzTGgN/gkA9hZDDjYO5W5w3ixbQaU0YOy4Vrgz0opZmltQL3UztZgM7af 8o+9cPpINSubMQ+INW2j9mQJabuiwh4rQvFosafZTrWs/RN4VIhaP9FWnx9K+FyUhIYZ 92Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=SmL56eN7cuqIi3nG6ukWJdaxQH/xfcHG0+/TaiIZgx4=; b=fAD5X97sNf9aUF4FIYxR0vUeDj5Lmy86g3vvcjzE1bMrGz5CTLb3R/aF3DMIsd5C1C jNkAGUldxBJlYjCt7jWdVRloIV0DuMvI0/ew1BB39NO1aG2RFocf9zoJtHGH3mVSUREs yt7m4pXoCBqcdlJMt86v13S48J68KEUztjKpSXnWbJz4FDGBjkvHECkLxVztCIZSMgRt x6BfTGiT2ZOVrPLurRK53nxR1iY1uCbG8JzeYxOxo1zQPBYBYQgD/o/nfOToxMaFeBb5 Spwz0NYV2OThO5oCETZgI3sqeJ6LaWIFYOSNCl53sCBi+s1fV1f364tG4kWNLRiwAgVP XsSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DY5jkJ2i; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k124-v6si19537387iok.34.2018.05.07.08.57.47; Mon, 07 May 2018 08:57:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DY5jkJ2i; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752761AbeEGP5o (ORCPT + 6 others); Mon, 7 May 2018 11:57:44 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:39918 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752781AbeEGP5m (ORCPT ); Mon, 7 May 2018 11:57:42 -0400 Received: by mail-wr0-f194.google.com with SMTP id q3-v6so29287607wrj.6 for ; Mon, 07 May 2018 08:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3OeSCMQTnB5Zbn37nOARIKXFybH8gj/fV34v2WcaUfM=; b=DY5jkJ2igWQmcrSnfRHT3jen+Z6Y7tlZwISSvfKuUkoz+XgyGIXcX1IjwJZZWsYpD3 yCNCYbRjW4Cq9FqLIvWN10wYD9EkQ8S8ANiNgWGzRizwNy20o+i3XF6Np/I7qSvmmyUi CBClJpLzSeuY300+ymTXCJJ2sOlv46V/FBUow= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3OeSCMQTnB5Zbn37nOARIKXFybH8gj/fV34v2WcaUfM=; b=rKXwbdqCey7HFxiFF7ApUxZbkOfof+nNm5lnSwVE/ZFYcTSyu/zvEpdmutYBd3ZyWA OwnAEaGtrs9kXi2Eq49OhB8CHI+VGsQILA6l/OFagE1FFqGNCre93/c4K+ISJbi25G0Y kX9Z7hqKvO68EF/odb6zmsLJwZEEJvheXi31XBsah6M215A8Lr5jy6vCm9zpKFloHWdT zD6LrWRTsL+b6kMBp43lD3Vga8sKKWlYawxToIN4E4p36fwiWgeBSyiHrsQ4xrRk7bqT KQ1WJv2yzEXKTEu5zhkrJOjX37qEPGN9b475VVclqWaphvtHwPaE8nwTDUCXekdrGV5d jBCA== X-Gm-Message-State: ALQs6tD7kgOqNZZIUAC5bMYugf2kybs13HSAlsGy+RxsVo7A/I4OOpxA SXv74eQvpubURF8djtx6RnenwA== X-Received: by 2002:adf:86ac:: with SMTP id 41-v6mr28757047wrx.260.1525708660884; Mon, 07 May 2018 08:57:40 -0700 (PDT) Received: from arch-late.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id y42-v6sm32294807wry.21.2018.05.07.08.57.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 May 2018 08:57:40 -0700 (PDT) From: Rui Miguel Silva To: mchehab@kernel.org, sakari.ailus@linux.intel.com, hverkuil@xs4all.nl, Rob Herring Cc: linux-media@vger.kernel.org, Fabio Estevam , devicetree@vger.kernel.org, Ryan Harkin , Rui Miguel Silva Subject: [PATCH 3/4] media: ov2680: rename powerdown gpio and fix polarity Date: Mon, 7 May 2018 16:56:54 +0100 Message-Id: <20180507155655.1555-4-rui.silva@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180507155655.1555-1-rui.silva@linaro.org> References: <20180507155655.1555-1-rui.silva@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Rename the power control gpio to reset, since it is the same, and fix the polarity code since this gpio is active at low and not at high as controlled before. Signed-off-by: Rui Miguel Silva --- drivers/media/i2c/ov2680.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c index cc3d06096d51..8962b397211a 100644 --- a/drivers/media/i2c/ov2680.c +++ b/drivers/media/i2c/ov2680.c @@ -98,7 +98,7 @@ struct ov2680_dev { struct clk *xvclk; u32 xvclk_freq; - struct gpio_desc *pwdn_gpio; + struct gpio_desc *reset_gpio; struct mutex lock; /* protect members */ bool mode_pending_changes; @@ -295,19 +295,19 @@ static int ov2680_load_regs(struct ov2680_dev *sensor, static void ov2680_power_up(struct ov2680_dev *sensor) { - if (!sensor->pwdn_gpio) + if (!sensor->reset_gpio) return; - gpiod_set_value(sensor->pwdn_gpio, 1); + gpiod_set_value(sensor->reset_gpio, 0); usleep_range(5000, 10000); } static void ov2680_power_down(struct ov2680_dev *sensor) { - if (!sensor->pwdn_gpio) + if (!sensor->reset_gpio) return; - gpiod_set_value(sensor->pwdn_gpio, 0); + gpiod_set_value(sensor->reset_gpio, 1); usleep_range(5000, 10000); } @@ -535,7 +535,7 @@ static int ov2680_power_on(struct ov2680_dev *sensor) if (sensor->is_enabled) return 0; - if (!sensor->pwdn_gpio) { + if (!sensor->reset_gpio) { ret = ov2680_write_reg(sensor, OV2680_REG_SOFT_RESET, 0x01); if (ret != 0) { dev_err(dev, "sensor soft reset failed\n"); @@ -990,11 +990,11 @@ static int ov2860_parse_dt(struct ov2680_dev *sensor) struct device *dev = ov2680_to_dev(sensor); int ret; - sensor->pwdn_gpio = devm_gpiod_get_optional(dev, "powerdown", - GPIOD_OUT_HIGH); - ret = PTR_ERR_OR_ZERO(sensor->pwdn_gpio); + sensor->reset_gpio = devm_gpiod_get_optional(dev, "reset", + GPIOD_OUT_HIGH); + ret = PTR_ERR_OR_ZERO(sensor->reset_gpio); if (ret < 0) { - dev_dbg(dev, "error while getting powerdown gpio: %d\n", ret); + dev_dbg(dev, "error while getting reset gpio: %d\n", ret); return ret; }