Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6337590yba; Thu, 11 Apr 2019 17:49:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvLz3+NTUWzawTznvoEdM1exFUD58jjzArZIPBtFHkC8hRsdjw/F3b7k+SidMuPcLpoNXp X-Received: by 2002:a62:a513:: with SMTP id v19mr52918523pfm.212.1555030150111; Thu, 11 Apr 2019 17:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555030150; cv=none; d=google.com; s=arc-20160816; b=pL+7jXn6teKvG6wS4kioHNS3fHIExBP87fXjveis1qxBskX88tUdgStaUZ3Bo9joGI T+UXrJSUd6x/BEKAyS5iLOgK3wK3+zGroaHTGz2M7say0a8WWdgiWiXWQKFjcDcOu/8B /UZS8KZw2DgVvVroAThuMxO8svFaB8eN8HUodtN9GV+jfg81Hmvn9OOdsCbO3voG2fof x36CLRzkX5QhXzRO4W6pm2TA/NosREXC99w0Os484sLBy4G28OwEXtczDfV/mq5GRT0g pVHxmCO27mr+altJR3fD9R29u01aRsEe1tkDodDDW9n112O3wNsJKSM56rbQB2e88sa+ ATfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:cc:to:subject :dkim-signature:dkim-filter; bh=EG5UUt1fhOOyO2dRubmqvo/jwSJJUu9GXL0ZwoRXhP8=; b=heCFCdTq8JegQ2whoTw97Y0suuyZbPlf/grcFJQSAeDi+yTk7wjxnmma7bz/cM8HRm QrUnuUCHKsfnm5pvNELHB6tapBgvmaPb/hKUg7xFK0ety3QIaQjSGArbrV1qprkcxxzR GLQrwpn7Spi5W1Or6ckD67+tLH1fws/dfqN5lafyCPQLAzK1l/O34JxNo2kD9ZTlYaRh seO/aL7bbjCfQ/qkVS7nWKSbINNokJ9abKTci4k6cm8njL3RmG7goC8yW59DxfCJs+Fu cm1NIzQaiz2ZRl81FurQwWyWdzZPgniYEdlRKctwx474kei57byznW4K4eCAh1/Raoge v0kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HRoTBOMn; 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=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v21si36558023pfe.119.2019.04.11.17.48.53; Thu, 11 Apr 2019 17:49:10 -0700 (PDT) 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=@samsung.com header.s=mail20170921 header.b=HRoTBOMn; 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=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbfDLAha (ORCPT + 99 others); Thu, 11 Apr 2019 20:37:30 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:51814 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726577AbfDLAha (ORCPT ); Thu, 11 Apr 2019 20:37:30 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20190412003727epoutp02d0ba3d7e5ce955fd67c2af1424a7d70d~UkwsRj3hC2199221992epoutp02X for ; Fri, 12 Apr 2019 00:37:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20190412003727epoutp02d0ba3d7e5ce955fd67c2af1424a7d70d~UkwsRj3hC2199221992epoutp02X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1555029447; bh=EG5UUt1fhOOyO2dRubmqvo/jwSJJUu9GXL0ZwoRXhP8=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=HRoTBOMnQnT2n26u3MSVzQ5yq9E18Ox5b5LWIHfx4QAAXBSA/iIcv4Q/71Cwyy3ah PWZswI7hf00MaQdOH1NdVYc5V2TzwYYrlCUjfWGexyQ9pjmFr7Hf5IOkA/KAgHN5Bq oX5l9nTHXYmk1uAa2N1kS02wka7h5IblUG/GGEFs= Received: from epsmges1p5.samsung.com (unknown [182.195.40.152]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20190412003724epcas1p458f5ab5942469a27ee81cd27c224ccec~Ukwpl5MfY1085410854epcas1p4U; Fri, 12 Apr 2019 00:37:24 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 4E.E5.04108.4CDDFAC5; Fri, 12 Apr 2019 09:37:24 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20190412003723epcas1p4841ac39da7b1dcdd379101294fcd8407~Ukwo7Kqhj1085410854epcas1p4T; Fri, 12 Apr 2019 00:37:23 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190412003723epsmtrp22e9a84858a3f7af368efc69f63bdc8a1~Ukwo6T7SL0232002320epsmtrp2h; Fri, 12 Apr 2019 00:37:23 +0000 (GMT) X-AuditID: b6c32a39-89fff7000000100c-39-5cafddc49cf4 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 2E.68.03692.3CDDFAC5; Fri, 12 Apr 2019 09:37:23 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190412003723epsmtip1538b52e9fbd2e30dbbab1fcb3cb58274~UkwoyP9tf1377413774epsmtip1e; Fri, 12 Apr 2019 00:37:23 +0000 (GMT) Subject: Re: [PATCH] extcon: arizona: Disable mic detect if running when driver is removed To: Charles Keepax , myungjoo.ham@samsung.com Cc: linux-kernel@vger.kernel.org, patches@opensource.cirrus.com From: Chanwoo Choi Organization: Samsung Electronics Message-ID: <22018fcb-ac96-8cc4-c432-770962b37ef4@samsung.com> Date: Fri, 12 Apr 2019 09:38:12 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190404163356.17773-1-ckeepax@opensource.cirrus.com> Content-Language: en-US Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTcRTH+e3e3U1rdZuaJ3vZjSINH1ebTksLFBkoNCgoyrLLvOhwj9vu 7C1Z4iPN3iTZqMyMpdnKVsjCBFszg8wwIbThchIWMSkrKqLadpX873PO75zz/X1/vyPF5PVE lFRrMLMmA6OjiFD84ZOYuDin25af2HljjvJ1ZQdSDjoshHLkmJVQTk12izfhqgbLX6Q6ZW9F qqmOZWpsR8mGYpYpZE3RrEFjLNQaijKo3C0FWQWKlEQ6jk5TplLRBkbPZlDZeeq4HK3Or0ZF 72N0pf6UmuF5KiFzg8lYamaji428OYNiuUIdl8bF84yeLzUUxWuM+nQ6MTFJ4S/cU1JcX2uR cLZ5B5znHuHlyDunFoVIgVwHI333RLUoVConOxH0jkzgQvAFgfv+C7EQfEfQUH9HPNPiO20l hIMuBC6vDROCSQRfr48Fq8LIfBisKQ9yOJkHTZX9QcbIjdBU8SrIBBkL3RNviADPJ1fA0A8v CrCMzIQ2xygWYJxcBfahNkmAI8jtMOq6KxZqFkDfpXE8wCFkFljfn8CF+ZEwPH5VJPByqHhw OXg5IJ8R8LW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cg9mfe1/Kt/72s06BJjKPruOOf+yY9zJR/8v6r3zDBpktRmqfV/NM1aRZfMe/04 MkH08hauJduEBdfZLvz5jC1+/rXFV7N53mna/513SerjBK3rHY/rlr6Lbky1khETkbmiso83 g92lUbydeX984eLpZq4nRHvfXeQrPPGj017rz5wIJZbijERDLeai4kQA3cplsYoCAAA= X-CMS-MailID: 20190412003723epcas1p4841ac39da7b1dcdd379101294fcd8407 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20190404163407epcas1p2a59f81b2486e552d35b8a900dffa53b5 References: <20190404163356.17773-1-ckeepax@opensource.cirrus.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Charles, On 19. 4. 5. 오전 1:33, Charles Keepax wrote: > Microphone detection provides the button detection features on the > Arizona CODECs as such it will be running if the jack is currently > inserted. If the driver is unbound whilst the jack is still inserted > this will cause warnings from the regulator framework as the MICVDD > regulator is put but was never disabled. > > Correct this by disabling microphone detection on driver removal and if > the microphone detection was running disable the regulator and put the > runtime reference that was currently held. > > Signed-off-by: Charles Keepax > --- > drivers/extcon/extcon-arizona.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c > index da0e9bc4262fa..9327479c719c2 100644 > --- a/drivers/extcon/extcon-arizona.c > +++ b/drivers/extcon/extcon-arizona.c > @@ -1726,6 +1726,16 @@ static int arizona_extcon_remove(struct platform_device *pdev) > struct arizona_extcon_info *info = platform_get_drvdata(pdev); > struct arizona *arizona = info->arizona; > int jack_irq_rise, jack_irq_fall; > + bool change; > + > + regmap_update_bits_check(arizona->regmap, ARIZONA_MIC_DETECT_1, > + ARIZONA_MICD_ENA, 0, > + &change); > + > + if (change) { > + regulator_disable(info->micvdd); > + pm_runtime_put(info->dev); > + }> > gpiod_put(info->micd_pol_gpio); > > Applied it. IMO, I think that this driver have to handle the exception handling when regmap_update_bits_check() returns error or 'change' value is not changed. This driver have same issue about exception handling on multiple places. Please take it on separate patche. -- Best Regards, Chanwoo Choi Samsung Electronics