From patchwork Wed Sep 18 17:03:34 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: 2908031 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 908C0BFF05 for ; Wed, 18 Sep 2013 17:04:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B4BD4203AC for ; Wed, 18 Sep 2013 17:04:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CDE432029B for ; Wed, 18 Sep 2013 17:04:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752812Ab3IRRDk (ORCPT ); Wed, 18 Sep 2013 13:03:40 -0400 Received: from mail-ea0-f179.google.com ([209.85.215.179]:33940 "EHLO mail-ea0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751921Ab3IRRDi (ORCPT ); Wed, 18 Sep 2013 13:03:38 -0400 Received: by mail-ea0-f179.google.com with SMTP id b10so3552126eae.24 for ; Wed, 18 Sep 2013 10:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=4JAHmpz/6eGV7FkuK7PN5sxoWrCoW/MVYAl+wI2vXUs=; b=aInLFYT3I2XhNS1Nr6k4RfcEGNAui0pgXaxn6cKyr8scbU/0HOWsWxZPDXS4nbs8J+ oHQAwa1NfViOVpU2iNkJSNezkCWIqJSVqOiFf507RseMo11OxdRuJ9r0XrX3acVmYZyt RDOE9rNrJn9vH98Zvf1fUSvHLmiQcjSG61WoVHF9Z38tSTtCvl5pCfyXzK5R65OaYpcu bSzWtwd0+Pkqw8j8gmoXydPF/FeGkBGjdGp4+kVNi66Wx+lyyLzTxVwGm6COfvXMewPG hUrhYn0QDeSIKzN9JnZffK99oy9VnPbp7VX6+hjbJAEqsNhlxPmgvsEFV8Epf77vkCQx i+AA== X-Received: by 10.14.216.201 with SMTP id g49mr3851083eep.77.1379523817092; Wed, 18 Sep 2013 10:03:37 -0700 (PDT) Received: from pali-elitebook.localnet ([2001:718:1e03:a01::1ca]) by mx.google.com with ESMTPSA id y47sm4300846eew.12.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Sep 2013 10:03:36 -0700 (PDT) From: Pali =?utf-8?q?Roh=C3=A1r?= To: balbi@ti.com Subject: [PATCH usb 2/2] usb: musb: Call atomic_notifier_call_chain when status is changed Date: Wed, 18 Sep 2013 19:03:34 +0200 User-Agent: KMail/1.13.7 (Linux/3.11.0-1+synaptics-generic; KDE/4.11.1; x86_64; ; ) Cc: Javier Martinez Canillas , Pavel Machek , Tony Lindgren , Anton Vorontsov , Russell King , David Woodhouse , "Greg Kroah-Hartman" , freemangordon@abv.bg, Aaro Koskinen , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Linux Kernel , linux-usb@vger.kernel.org References: <1378630239-10006-1-git-send-email-pali.rohar@gmail.com> <201309181843.49850@pali> <20130918164816.GN21559@radagast> In-Reply-To: <20130918164816.GN21559@radagast> MIME-Version: 1.0 Message-Id: <201309181903.34696@pali> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham 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 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); }