From patchwork Tue Jan 15 07:52:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 155633 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4587981jaa; Mon, 14 Jan 2019 23:53:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN7ezI6nc9/clWBDe/2onmi2TEF+tYklXsqImKbgzBlbYG3qCeoYdedtB88ufAJFNyVUwQZ5 X-Received: by 2002:a62:d2c1:: with SMTP id c184mr2695376pfg.248.1547538819797; Mon, 14 Jan 2019 23:53:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547538819; cv=none; d=google.com; s=arc-20160816; b=HtxQs97x1IiQzl+tNxDNWyV4eY1FMZ1uitIxghGif7r3gKpwaccouFrB1WVNTs4QH0 FlK7wQmakdvUAWxQ32nHUQOyyg30MjDrlR8h3vV1J4ru5KYmDzLgt8D5KrLVCThd2blh 62+JUBcIX9LTzktEOfqrmdxjjHX0oxiXGX5KCV7rw0TvoGaGk6K8XP5TdiUJpKcyU7qQ UBEpBERSeMa9pDYMisL9yu0mxQ/AqUMjSSjW7ewMi9HbT3LlrVvm/Gz57ezIoHAI5WMQ Es/QnOFQ2F6OD7OMtpDfSx6xoASPpzI/5ZVCq2amaQWKl5KA0zt5lJpNNmwieS7Dq6yE hpOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=N3BRL5c8XBWaHt94edkG7ztQOznUJvJUETVY/zaF1Hk=; b=gRGBn18HdiHQia9zrREjMHObyd93yLuGs4x8PDcXL4cchKnd55Q+0t0MUNOuScdyVL 6T3aQgIIyza63jbDm7F1b6vE6JdDLdLnYO8Onv1xK3DZiOsMK12msNpJSJH5MguQSHKb X6caOdYcYbvTmLLsmysXjd3OXSwH+11g/P0q+doe0Mu2+Hy/rr2Z/lqAVVD4qpyHHAP+ dG+JpuCEsAaA4jSLu0AAzrr9yPHCMAGLL4EeDQo3Nrt9WnxjPW2M9h7w6RIJqEiBmFDM qfUyigr/x1K7wpPnB/MbDVsO0YZzExWWRk9dd6Wbay30DFu7lGPdLUzgdvTYLtUBZGKF 4qBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QvxA6KP0; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (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 j14si2844041pgg.44.2019.01.14.23.53.39; Mon, 14 Jan 2019 23:53:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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=@linaro.org header.s=google header.b=QvxA6KP0; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728258AbfAOHxi (ORCPT + 5 others); Tue, 15 Jan 2019 02:53:38 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:45202 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728257AbfAOHxi (ORCPT ); Tue, 15 Jan 2019 02:53:38 -0500 Received: by mail-pg1-f193.google.com with SMTP id y4so869097pgc.12 for ; Mon, 14 Jan 2019 23:53:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=N3BRL5c8XBWaHt94edkG7ztQOznUJvJUETVY/zaF1Hk=; b=QvxA6KP0VrWDNTFRdKBAUi/zKB8s2K2cvFYgQc396xIej/UqG3aiLPXhN/VAYPEfXa xlOy69j9Y/VtbtsDYhmTt4O74WhNV6i+JtDOSf+y+hFpyESy21MVa2QVEi4XhWh52uCn 2bI36K5far3IFA/zcx/n/9esZ8W/K5k45U3MM= 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; bh=N3BRL5c8XBWaHt94edkG7ztQOznUJvJUETVY/zaF1Hk=; b=bHNR8XTlL5DsaPNkPErKL0+soDKcHm9KvNW41jUQOM5F+9ig7w5eHHQd6bKbbNveQm Wwg2qvkL1LBsuVyvAjgtrAuiF95R487CHXJv35ka/kAqPjaqS8CB6+QqHCwKVKbhNA6v 5hqe1pGfDVRzImrh90HbPdTRCHPpD5B9GSe5auWQjODTMVwNTL+1jmkRPgmlaNKUfIE6 5aPUupn34qamVEpNdnFdp6JWjAWX+kSOca9ZNjYYPnUy0pKMgr6Kv1TbYg1TirnyZIq6 LHQfic5maDrLY7VlMKpq8JTi1hg0VuPZNUvWisbScRcxecO5pHWG4O4VkEOy7eeIIn8+ SkiA== X-Gm-Message-State: AJcUukcDCK+auXUcbnwVWYSimHHL1MpjQvtSOHH9KbpBdRGi9msHFOWF RRnhaoEXtCIFYHJKRmyHeTonxQ== X-Received: by 2002:a63:4566:: with SMTP id u38mr2653482pgk.4.1547538818114; Mon, 14 Jan 2019 23:53:38 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id g3sm4340093pfe.37.2019.01.14.23.53.34 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Jan 2019 23:53:37 -0800 (PST) From: Baolin Wang To: linus.walleij@linaro.org, bgolaszewski@baylibre.com, orsonzhai@gmail.com, zhang.lyra@gmail.com Cc: baolin.wang@linaro.org, neo.hou@unisoc.com, broonie@kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] gpio: sprd: Fix the incorrect data register Date: Tue, 15 Jan 2019 15:52:58 +0800 Message-Id: <732ea4f8ff1bf3ad28bda543ae8e1727c78f8b3b.1547538574.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Neo Hou Since differnt type EICs have its own data register to read, thus fix the incorrect data register. Signed-off-by: Neo Hou Signed-off-by: Baolin Wang --- drivers/gpio/gpio-eic-sprd.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) -- 1.7.9.5 diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c index e0d6a0a..257df59 100644 --- a/drivers/gpio/gpio-eic-sprd.c +++ b/drivers/gpio/gpio-eic-sprd.c @@ -180,7 +180,18 @@ static void sprd_eic_free(struct gpio_chip *chip, unsigned int offset) static int sprd_eic_get(struct gpio_chip *chip, unsigned int offset) { - return sprd_eic_read(chip, offset, SPRD_EIC_DBNC_DATA); + struct sprd_eic *sprd_eic = gpiochip_get_data(chip); + + switch (sprd_eic->type) { + case SPRD_EIC_DEBOUNCE: + return sprd_eic_read(chip, offset, SPRD_EIC_DBNC_DATA); + case SPRD_EIC_ASYNC: + return sprd_eic_read(chip, offset, SPRD_EIC_ASYNC_DATA); + case SPRD_EIC_SYNC: + return sprd_eic_read(chip, offset, SPRD_EIC_SYNC_DATA); + default: + return -ENOTSUPP; + } } static int sprd_eic_direction_input(struct gpio_chip *chip, unsigned int offset) From patchwork Tue Jan 15 07:52:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 155634 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4588080jaa; Mon, 14 Jan 2019 23:53:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN7k+gfjr6sNcjAvk22hL6Rc9ixqwSVh5ftYzCexzsrh+2LrcB11Xot4YZ55GoXSlepG6hl/ X-Received: by 2002:a17:902:5601:: with SMTP id h1mr2826375pli.160.1547538829073; Mon, 14 Jan 2019 23:53:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547538829; cv=none; d=google.com; s=arc-20160816; b=tAtMtV9XNIT+OLza/ewB6CsNQnfzh7ubaYp+gyuzTPKHnEX4Naxfqq9P8xhJiGW/2d PbdYasIc1ofkNaDoWOytsumrRJu0uIkKQk1C3QYTl2GdroFd+dhxIX8R4i233SaSO1K7 mLgay13cSbAjHNhtyEP7Qvhjee82gvKQPPMkEaAe9S0WS3/bqDkgHJGrchNcddA66fKE vxZ4SvYKMeu7Ll6W8cqSVnUpKASrza9dKnZpRckjrpI6yK8CPyaBMMRZ3rT77M9TNp3q KbKBrmnZwSn8DIcD0whEc5GOS4hNTbO/15RvD+7XdBAN9/PPIWsSmmxPryK9DLTuG8Xy lvOg== 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:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=AEvLBlZn/8mftg4VajuyVnyyVBSF5IJc0mJx1Fn5t0c=; b=Q0dGaN7MduWzKdDjhGJMH2ICAGNhWEUPzuotcPMggWGRTQEhlK/lhSdgCPYljpNYwT 5XcfDsmkk63v0ZcY8C1yXQqMalfnuGCgVVjt7+oCDPHV7cknYfqALkKGTOx2QnsRMgDs z1g8QkEHHdE/mxegrsNmwubeP1rlfEgY25iZFDfbjmCWGF/Ldj0yXlLq75LlsikXa3vx RxT1ce/e/poSbnIiDy/2BHPfx9B16DxiGARIFtlMvUP6PB6NUYxWtoZjnPIlanxVrCP3 Id2A9jal1jqOVWfRPiFnOb5SkAdRfpXEi8Qtp7lA7c+dKq0dQ2zvnRGVCwRFJ+xFxLPF bziQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PWGTla8x; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (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 k135si2599888pgc.574.2019.01.14.23.53.48; Mon, 14 Jan 2019 23:53:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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=@linaro.org header.s=google header.b=PWGTla8x; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728295AbfAOHxm (ORCPT + 5 others); Tue, 15 Jan 2019 02:53:42 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:37071 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728286AbfAOHxm (ORCPT ); Tue, 15 Jan 2019 02:53:42 -0500 Received: by mail-pl1-f196.google.com with SMTP id b5so910507plr.4 for ; Mon, 14 Jan 2019 23:53:41 -0800 (PST) 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 :in-reply-to:references; bh=AEvLBlZn/8mftg4VajuyVnyyVBSF5IJc0mJx1Fn5t0c=; b=PWGTla8xPXHZJhFLEVc9niJ+2Y0vhunlWfEtSRRf0qSvZsrk4vGOPKU8et9lXEm1LK vJFGBEiho6XLF6aBtpR8XyRge9bNVDVbgzWimmGMJpgxnux8wngnmuDXqcLuDqaXywRt Ny4WtHmxE4ET3qp3wtpSFInOLiAhM8uXDQ1O0= 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:in-reply-to:references; bh=AEvLBlZn/8mftg4VajuyVnyyVBSF5IJc0mJx1Fn5t0c=; b=YBdO6Nofx4sJozCoz9TzLuLWyQ5RceJKqPmuvmeanGSgQj/6WnZQk7Sd2v/2RacVtm vqAmy5WdO3C8zP5nCc7j0qeGBHBx0etY1kWIbO6TuulboDKANlR2AiUCVHtzpT9uHoFA 25tQqJ/I2l4p5UKn+a4s16tPiW2irP8M2+CYgG5pRfG36Q6tHHTQqn/T2fzxxAuhc+TX MKSD39a2Ot7pCGVjdxa917xukb/WVra4ybKZ+6/h7C1jSUWOClHjcb4ENcJRW/WZr1Qu K6VKQ6gj6FBopEYhgKSdopSy9v2tdF02rXFPxmXY1pW1N60iqfxv0CDGv5hi0SbUZ2qi ZLAw== X-Gm-Message-State: AJcUukdY/EOhuiHEsBk59VTj/DwFa8PBLpzfp+j7Wio+BSQ3tVzofWru fI6Bcyi3BKoJNtl6oPrKTtPiew== X-Received: by 2002:a17:902:2006:: with SMTP id n6mr2812113pla.66.1547538821635; Mon, 14 Jan 2019 23:53:41 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id g3sm4340093pfe.37.2019.01.14.23.53.38 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Jan 2019 23:53:40 -0800 (PST) From: Baolin Wang To: linus.walleij@linaro.org, bgolaszewski@baylibre.com, orsonzhai@gmail.com, zhang.lyra@gmail.com Cc: baolin.wang@linaro.org, neo.hou@unisoc.com, broonie@kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] gpio: sprd: Fix incorrect irq type setting for the async EIC Date: Tue, 15 Jan 2019 15:52:59 +0800 Message-Id: <3dd0a29b2f42d41ddfa5b30b68926eb58ebfc3a9.1547538574.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <732ea4f8ff1bf3ad28bda543ae8e1727c78f8b3b.1547538574.git.baolin.wang@linaro.org> References: <732ea4f8ff1bf3ad28bda543ae8e1727c78f8b3b.1547538574.git.baolin.wang@linaro.org> In-Reply-To: <732ea4f8ff1bf3ad28bda543ae8e1727c78f8b3b.1547538574.git.baolin.wang@linaro.org> References: <732ea4f8ff1bf3ad28bda543ae8e1727c78f8b3b.1547538574.git.baolin.wang@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Neo Hou When setting async EIC as IRQ_TYPE_EDGE_BOTH type, we missed to set the SPRD_EIC_ASYNC_INTMODE register to 0, which means detecting edge signals. Thus this patch fixes the issue. Signed-off-by: Neo Hou Signed-off-by: Baolin Wang --- drivers/gpio/gpio-eic-sprd.c | 1 + 1 file changed, 1 insertion(+) -- 1.7.9.5 diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c index 257df59..e41223c 100644 --- a/drivers/gpio/gpio-eic-sprd.c +++ b/drivers/gpio/gpio-eic-sprd.c @@ -379,6 +379,7 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) irq_set_handler_locked(data, handle_edge_irq); break; case IRQ_TYPE_EDGE_BOTH: + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0); sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 1); irq_set_handler_locked(data, handle_edge_irq); break;