From patchwork Mon Nov 3 16:32:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 40039 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 208CA21894 for ; Mon, 3 Nov 2014 16:33:55 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id p9sf2677933lbv.5 for ; Mon, 03 Nov 2014 08:33:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=HzwYYAwK7YnVsjUOqw7wxVJey5n24oMPNfxq2DPgW+8=; b=JEmvMvvIy0AxGogD+cSUpQRudOvtkFLj9ocYY+e+KlYQ7IZsh+Mk2YB0mTXoGDenhV ZvG2lv+Crs4OsSa9MQLH8bhLPhdvjRtdfFCgdcBIiBXvrru4GtkMlIA5UN8hA36RhaxJ hWs+5pnLyQbl5iHhE1aqgfNujDKk6FDOgEAt5DWIanEgZcOkBiR60Z3lsKc3J8av1DmR zUuGcSuch0Woj5XjFNEnICryR49PtB3sWkC0iTqBMPJW0vcpytIGSLkA2IfOUGoNPp6U jOjFVR8p3+j0so204bSWpGI3qFkc7Klg+hhdGUJ7cgvrwmi6krR2i+q3nYxth1/KaAQi A/vQ== X-Gm-Message-State: ALoCoQnGIN2R5241m4QJSpdQ5D8dvUEhiWGAox2u0m1PQXFTs0GcyAhAIKLShIPEUgfsTW2qH3O0 X-Received: by 10.112.138.202 with SMTP id qs10mr7465469lbb.5.1415032433898; Mon, 03 Nov 2014 08:33:53 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.194 with SMTP id t2ls726258laa.14.gmail; Mon, 03 Nov 2014 08:33:53 -0800 (PST) X-Received: by 10.112.54.162 with SMTP id k2mr51954453lbp.63.1415032433730; Mon, 03 Nov 2014 08:33:53 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id li1si134216lab.112.2014.11.03.08.33.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 08:33:53 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id hz20so7221884lab.23 for ; Mon, 03 Nov 2014 08:33:53 -0800 (PST) X-Received: by 10.152.116.102 with SMTP id jv6mr52324339lab.40.1415032433617; Mon, 03 Nov 2014 08:33:53 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.141.34 with SMTP id rl2csp17483lbb; Mon, 3 Nov 2014 08:33:52 -0800 (PST) X-Received: by 10.68.104.194 with SMTP id gg2mr4327868pbb.119.1415032431930; Mon, 03 Nov 2014 08:33:51 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nn13si6081604pdb.204.2014.11.03.08.33.51 for ; Mon, 03 Nov 2014 08:33:51 -0800 (PST) Received-SPF: none (google.com: linux-omap-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752531AbaKCQdu (ORCPT + 5 others); Mon, 3 Nov 2014 11:33:50 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:43451 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752279AbaKCQdG (ORCPT ); Mon, 3 Nov 2014 11:33:06 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id sA3GX2iG015358; Mon, 3 Nov 2014 10:33:02 -0600 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA3GX2wJ007373; Mon, 3 Nov 2014 10:33:02 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Mon, 3 Nov 2014 10:33:02 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA3GX11h019810; Mon, 3 Nov 2014 10:33:02 -0600 From: Felipe Balbi To: , CC: Linux Kernel Mailing List , Linux OMAP Mailing List , , , George Cherian Subject: [PATCH 4/4] extcon: gpio: Add support for using cable names Date: Mon, 3 Nov 2014 10:32:30 -0600 Message-ID: <1415032350-8459-5-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1415032350-8459-1-git-send-email-balbi@ti.com> References: <1415032350-8459-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: George Cherian Add support for using cable names. Enables other drivers to register interest and get notified using extcon provided notifier call backs. Signed-off-by: George Cherian Signed-off-by: Sekhar Nori Signed-off-by: Felipe Balbi --- Documentation/devicetree/bindings/extcon/extcon-gpio.txt | 2 ++ drivers/extcon/extcon-gpio.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/extcon/extcon-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-gpio.txt index 5fe6846..f19aeb4 100644 --- a/Documentation/devicetree/bindings/extcon/extcon-gpio.txt +++ b/Documentation/devicetree/bindings/extcon/extcon-gpio.txt @@ -7,6 +7,7 @@ Required Properties: - compatible: should be: * "linux,extcon-gpio" - gpios: specifies the gpio pin used. + - cable-name: Name of the cable used. Optional Properties: - debounce: Debounce time for GPIO IRQ in ms @@ -18,4 +19,5 @@ Eg: compatible = "linux,extcon-gpio"; gpios = <&gpio3 12 GPIO_ACTIVE_HIGH>; debounce = <20>; + cable-name = "USB-HOST"; }; diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c index 7191d28..cbe35af 100644 --- a/drivers/extcon/extcon-gpio.c +++ b/drivers/extcon/extcon-gpio.c @@ -42,6 +42,7 @@ struct gpio_extcon_data { struct delayed_work work; unsigned long debounce_jiffies; bool check_on_resume; + const char *cable_name[1]; }; static void gpio_extcon_work(struct work_struct *work) @@ -112,6 +113,9 @@ static int gpio_extcon_probe(struct platform_device *pdev) of_property_read_u32(np, "debounce", &debounce); irq = gpiod_to_irq(extcon_data->gpiod); irq_flags = irq_get_trigger_type(irq); + of_property_read_string_index(np, "cable-name", 0, + extcon_data->cable_name); + extcon_data->edev->supported_cable = extcon_data->cable_name; } else { if (!pdata) return -EBUSY;