From patchwork Sun Sep 8 08:50:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 2858271 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F06529F2D6 for ; Sun, 8 Sep 2013 08:52:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 574AB20319 for ; Sun, 8 Sep 2013 08:52:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 860042027D for ; Sun, 8 Sep 2013 08:52:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752285Ab3IHIvP (ORCPT ); Sun, 8 Sep 2013 04:51:15 -0400 Received: from mail-ee0-f54.google.com ([74.125.83.54]:37634 "EHLO mail-ee0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752051Ab3IHIvM (ORCPT ); Sun, 8 Sep 2013 04:51:12 -0400 Received: by mail-ee0-f54.google.com with SMTP id e53so2504772eek.13 for ; Sun, 08 Sep 2013 01:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=+Si90aHfK2sUEOItR3WCVtVTJnWNR7CNX+YGOSicyl4=; b=IHJsIAXdGpt3NYSUq4CA6YV1Afa4ZIZWokgY62FSq18YnYBgNxIpxQAiZhkUTdVHTo gTcItOsVO5Ccn8i0lZ1QhCJFMUCJhar+uGa8eR+qEkhfRK58D6qvf9H9ZRR6lRAiipfz vBaiarBIfkXNTfySNpEaV8C0ViGhjUHcJSPB+ePRbx387UPxCG+gw99kAh/zLDZmcvfk HUqPgobQfwX9P8yO4trudnPmniCwQiVF9PdlrGADRxx+fGwyc7Xvxuj72H80GDhnV5mH M2gJFJUDBWQUnD56cZkoXIfZquDMb8EnL1kc4xxhlUtk25CjdDCdxOrkkX//GTH4d79O CZww== X-Received: by 10.14.182.136 with SMTP id o8mr792747eem.57.1378630271016; Sun, 08 Sep 2013 01:51:11 -0700 (PDT) Received: from Pali-EliteBook.kolej.mff.cuni.cz (pali.kolej.mff.cuni.cz. [78.128.193.202]) by mx.google.com with ESMTPSA id z12sm11627397eev.6.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Sep 2013 01:51:10 -0700 (PDT) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Tony Lindgren , Anton Vorontsov Cc: Russell King , David Woodhouse , Felipe Balbi , Greg Kroah-Hartman , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, freemangordon@abv.bg, aaro.koskinen@iki.fi, pavel@ucw.cz, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH 1/4] usb: musb: Call atomic_notifier_call_chain when status is changed Date: Sun, 8 Sep 2013 10:50:36 +0200 Message-Id: <1378630239-10006-2-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378630239-10006-1-git-send-email-pali.rohar@gmail.com> References: <1378630239-10006-1-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP More power supply drivers depends on vbus events and without it they not working. Power supply drivers using usb_register_notifier, so to deliver events it is needed to call atomic_notifier_call_chain. So without atomic notifier power supply driver isp1704 not retrieving vbus status and reporting bogus values to userspace and also to board platform data functions. Without proper data charger drivers trying to charge battery also when charger is disconnected or do not start charging when wallcharger connects. Atomic notifier in musb driver was used before v3.5 and was replaced with omap mailbox. This patch adding atomic_notifier_call_chain call from function omap_musb_set_mailbox. Signed-off-by: Pali Rohár --- drivers/usb/musb/omap2430.c | 3 +++ drivers/usb/phy/phy-twl4030-usb.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index f44e8b5..5c40252 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -305,6 +305,9 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue) default: dev_dbg(dev, "ID float\n"); } + + atomic_notifier_call_chain(&musb->xceiv->notifier, + musb->xceiv->last_event, NULL); } diff --git a/drivers/usb/phy/phy-twl4030-usb.c b/drivers/usb/phy/phy-twl4030-usb.c index 8f78d2d..efe6155 100644 --- a/drivers/usb/phy/phy-twl4030-usb.c +++ b/drivers/usb/phy/phy-twl4030-usb.c @@ -705,6 +705,8 @@ static int twl4030_usb_probe(struct platform_device *pdev) if (device_create_file(&pdev->dev, &dev_attr_vbus)) dev_warn(&pdev->dev, "could not create sysfs file\n"); + ATOMIC_INIT_NOTIFIER_HEAD(&twl->phy.notifier); + /* Our job is to use irqs and status from the power module * to keep the transceiver disabled when nothing's connected. *