Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp952947img; Thu, 28 Feb 2019 10:28:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxkwUTwlRSw3IyLPTU8fq9Kk5po/EOTTsZDgD+2yjjUzqCV70EU50G9AkK3ChkN73noU9eZ X-Received: by 2002:a17:902:a50a:: with SMTP id s10mr714562plq.223.1551378493314; Thu, 28 Feb 2019 10:28:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551378493; cv=none; d=google.com; s=arc-20160816; b=mDQu5HqMOa3P9nJQmI9YXVtW+Zgu8Yw9rD2F/jFedbdzysSKgma9lsLvqnsTC/fA6n aau2wessqHBqbDQpUgVT1qCD1Alk/b6zwFz1w/ejIIlg5y9tx0KDHO6c1g0vw7kujXQk dDsl3tlynVT7hnYdHViWfISEGTCKLwGJPevQX55WIRxcceF85W9zsXikF0fQSeNw9r1h 4CuIWHpagakrifogkWdrFovg9PmvcXuOShN2nZNp37hP9xRG3TwIuZA32OZvyhOYfUhg 8SVGqnlYaD3T4tlybU49XfJB2ffIrWOVUFcR6v5S9WcV1gJ4NNbc5VClLAQ9bjZPdIBD sBvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=x41NJ0M0ISDzhYINLlifVt4BbR61KBJ/mAc80ss8IoM=; b=QCLHXuvbUC+bbm8J8loyq40CMKoIJySDajINk5hnFNpeF3rxGGXPCWgJs44Sxy5WO0 8c4XTRBlv7BMXWbZCotlok21EuvED+1BEzcgQNqDnbBGL7AHDAWjelkaIzrnpyGLMFb+ hGDhtMniZDDD/oYPSjKtA2Tq2i0SmkO8kwafnZWwW8XVMJuY/WrgiU66w2uqDloMcyLt 4C3p4xB7LcFCy+wpeukokDoyMeFuveQNYWP9nKzFKEE5tfyeKDuk613UXQwZ9v0ZJPwz zENB4TMQzblKE/pYBGS6X4316fvaCxV7lCmaESeakjCOohv1JpoNpRyt8w9iJPj62Zj5 Yk8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YQYF78lr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si18015350pgc.122.2019.02.28.10.27.57; Thu, 28 Feb 2019 10:28:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@gmail.com header.s=20161025 header.b=YQYF78lr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730388AbfB1Q5v (ORCPT + 99 others); Thu, 28 Feb 2019 11:57:51 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:39271 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725918AbfB1Q5u (ORCPT ); Thu, 28 Feb 2019 11:57:50 -0500 Received: by mail-it1-f193.google.com with SMTP id l15so16717036iti.4; Thu, 28 Feb 2019 08:57:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=x41NJ0M0ISDzhYINLlifVt4BbR61KBJ/mAc80ss8IoM=; b=YQYF78lrGPsYxhuaUpB/soQHL/mxFq2aawL35kg/ylxXrIsnF0lkwu8PtkUsJDnkYX epMQfletN5eMwfcyTjmgk5FwavCEPA50EHT8CG7+IpzCmvn4sf5Z5IHzLyGLHc0VDYAT cP7yIENl0F92W2IynViWQQ8ZT0D3IiHKf4Bb0Yel20An49MgbdzNHw/LXlsx67gsx803 tmSt2j/3MaDsXQLBu4ynLhRxNE7/mX8LpoEAZpWHeXaA3ZPWq1jLK/jekQKF58T775Gz VTglJ6VJk8Jo+XQ+VcEuX7J/zyElRUbIcvthqztCt5g0BvIWLG+QREz4+e1b4lTHAC5d rvZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=x41NJ0M0ISDzhYINLlifVt4BbR61KBJ/mAc80ss8IoM=; b=tinJAM9sJBHA7CST/8wC5pEJLacOQx85ykTOmKSZs1lnU1YseHweNl/2E2Znn4LGoT F4uA1BOzb7KEkDvar5aAT88SK8nxb/6+Bmyg7GDasrrqp6lCcVHGLE+k4erDaGNS/X4t 2kgbAOdMxr2ESKLB8aTNZDuJ6AcGF1BoFuwgQwdtTsPgsUHXwsjF3LM+8LcxL7g9xw5Q 5DqWyn4a8PYtvdu5PH6P7Iwd2NzhIUEvw8Ie6dSrbn1YCuihdztJ/701XqEiEjtAIip0 WyJm5JYEf4MIqr/LDFStxt8mW7Z8B6tXRiwvegcEcKMvoFoBvHL0KYRM47B1bjdY/NoW GbhQ== X-Gm-Message-State: APjAAAW2iqC9Mr84/YcOKubiGqOwtE4O9cmebC2BSrEw6kJ0gxBvZLhP iLW8oA7DI3RImyJLWIXmkw== X-Received: by 2002:a02:7e87:: with SMTP id g7mr295jae.92.1551373069987; Thu, 28 Feb 2019 08:57:49 -0800 (PST) Received: from r (CPE1cabc0918a93-CM1cabc0918a90.cpe.net.cable.rogers.com. [99.229.26.117]) by smtp.gmail.com with ESMTPSA id v8sm7226147iop.42.2019.02.28.08.57.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 08:57:49 -0800 (PST) Date: Thu, 28 Feb 2019 11:57:30 -0500 From: Robert Yang To: Tony Lindgren , Lee Jones Cc: linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH] mfd: tps65910: Properly disable the power on state Message-ID: <20190228165730.GA14387@r> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the tps65910/1 datasheets under "Device POWER ON Disable Conditions". There are four conditions which can disable power on: Long press interrupt (PWRON_LP_IT) OR thermal trip OR DEV_OFF bit OR DEV_OFF_RST bit. The Ouya game console has TPS65911. Before this patch the device will not power off through the pm_power_off call. The power light stays on and the device heatsink is warm. Long pressing the power button can power off the device. After this patch the device powers off correctly when calling power off through userspace software. Signed-off-by: Robert Yang --- drivers/mfd/tps65910.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c index aa3d472a10ff..c067dcacbe61 100644 --- a/drivers/mfd/tps65910.c +++ b/drivers/mfd/tps65910.c @@ -445,8 +445,12 @@ static void tps65910_power_off(void) DEVCTRL_PWR_OFF_MASK) < 0) return; - tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL, - DEVCTRL_DEV_ON_MASK); + if (tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL, + DEVCTRL_DEV_ON_MASK) < 0) + return; + + tps65910_reg_set_bits(tps65910, TPS65910_DEVCTRL, + DEVCTRL_DEV_OFF_MASK); } static int tps65910_i2c_probe(struct i2c_client *i2c, -- 2.17.1