From patchwork Thu Dec 27 19:52:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 10744039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8764F746 for ; Thu, 27 Dec 2018 19:52:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76DD728AA1 for ; Thu, 27 Dec 2018 19:52:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A9B128AA7; Thu, 27 Dec 2018 19:52:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1C2E128AA1 for ; Thu, 27 Dec 2018 19:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=4x6QTAypE3+EANsCJY+tkMvNH88ng/d6TvZ7CiEWZIE=; b=DhJ FgTA5j25A8LvxqtPnT8nYBJbesKLm6v2tjSJTiA3f+KgQRnAiLfLBkndFLRd3YJ+6Uwd5Xz725u8l HG1iLGg22abq+RK6IB0f30+mhgi5fQIkEnmBvHeHLLq62nHYP6crOD2KmJrhUlPINcdDGDEbpDFof IhX701s3HjIJQHkefylFtNP1rQUu/RN48DEqmeqpmeas0tZsJfIxgzPxhswmnxBQUXDNuEln1+sZL b7uD5DYu/f1e8DmTT56EnlsdtsnpxOjWQoJ4olnttyRfM5y5+UMjcelPEMJFaVC2RCd4G5+vXda6X uyL/LuLlfBn9jizw7AAvhBYVZh4BSdA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gcbhx-0006Ki-5C; Thu, 27 Dec 2018 19:52:41 +0000 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gcbht-0005jN-Hk for linux-arm-kernel@lists.infradead.org; Thu, 27 Dec 2018 19:52:39 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 5D4DF806DE; Thu, 27 Dec 2018 20:52:18 +0100 (CET) Date: Thu, 27 Dec 2018 20:52:21 +0100 From: Pavel Machek To: Sebastian Reichel , linux-pm@vger.kernel.org, kernel list , linux-arm-kernel , linux-omap@vger.kernel.org, tony@atomide.com, nekit1000@gmail.com, mpartap@gmx.net, merlijn@wizzup.org Subject: cpcap-charger: generate events for userspace Message-ID: <20181227195221.GA11920@amd> MIME-Version: 1.0 User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181227_115237_802187_FC8A7F6B X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The driver doesn't generate uevents on charger connect/disconnect. This leads to UPower not detecting when AC is on or off... and that is bad. Reported by Arthur D. on github ( https://github.com/maemo-leste/bugtracker/issues/206 ), thanks to Merlijn Wajer for suggesting a fix. Cc: stable@kernel.org Signed-off-by: Pavel Machek Acked-by: Tony Lindgren diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c index 9e8ff5c..7d8b4d5 100644 --- a/drivers/power/supply/cpcap-charger.c +++ b/drivers/power/supply/cpcap-charger.c @@ -576,6 +576,7 @@ static void cpcap_usb_detect(struct work_struct *work) goto out_err; } + power_supply_changed(ddata->usb); return; out_err: