Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753252Ab3DOMNz (ORCPT ); Mon, 15 Apr 2013 08:13:55 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:33833 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752745Ab3DOMNy (ORCPT ); Mon, 15 Apr 2013 08:13:54 -0400 MIME-Version: 1.0 X-Originating-IP: [122.121.49.149] In-Reply-To: <516BE5AE.3020703@stericsson.com> References: <1365424274.21989.2.camel@phoenix> <516BB444.7010508@stericsson.com> <516BE5AE.3020703@stericsson.com> Date: Mon, 15 Apr 2013 20:13:53 +0800 Message-ID: Subject: Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators From: Axel Lin To: =?ISO-8859-1?Q?Bengt_J=F6nsson?= Cc: Mark Brown , Lee Jones , Yvan FILLION , Liam Girdwood , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1037 Lines: 23 > I guess what you don't like with the current approach is that the driver > returns REGULATOR_MODE_IDLE in some cases where the mode register is set to > LP. But I think, with patch applied, the control may be wrong in some cases > because the regulator framework will call get_mode and see that the mode is > already correct and not call set_mode so lp_mode_req will not get updated. I I got your point now. My point is get_mode() should always return "correct" status by reading register value. And as you mentioned, regulator_set_mode() did check current mode and won't call set_mode callback if current mode is the same as the target mode. And that is why this patch won't work. However, Make get_mode() return "incorrect" status to avoid above issue looks wrong to me. Regards, Axel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/