diff mbox series

platform/x86: int3472: Add strobe GPIO function

Message ID 20231007021309.9332-1-hao.yao@intel.com (mailing list archive)
State Changes Requested, archived
Headers show
Series platform/x86: int3472: Add strobe GPIO function | expand

Commit Message

Hao Yao Oct. 7, 2023, 2:13 a.m. UTC
Strobe pin is used for Lattice MIPI aggregator to control the LED
so it can be handled together with privacy LED.

Signed-off-by: Hao Yao <hao.yao@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/platform/x86/intel/int3472/common.h   | 1 +
 drivers/platform/x86/intel/int3472/discrete.c | 2 ++
 2 files changed, 3 insertions(+)

Comments

Andy Shevchenko Oct. 7, 2023, 8:22 a.m. UTC | #1
On Sat, Oct 07, 2023 at 10:13:09AM +0800, Hao Yao wrote:
> Strobe pin is used for Lattice MIPI aggregator to control the LED
> so it can be handled together with privacy LED.

Thinking about this more, I am not now sure that this is a good approach.
The idea behind the STROBE LED is that is used for flash light and should
not be like on/off state, but rather the (quite) short pulse.

Combining these two together may even overheat the real strobe LED if used.

That said, is that platform using strobe GPIO for the privacy LED for real?!
Hao Yao Oct. 7, 2023, 10:23 a.m. UTC | #2
Thank you Andy,

On 2023/10/7 16:22, Andy Shevchenko wrote:
> On Sat, Oct 07, 2023 at 10:13:09AM +0800, Hao Yao wrote:
>> Strobe pin is used for Lattice MIPI aggregator to control the LED
>> so it can be handled together with privacy LED.
> 
> Thinking about this more, I am not now sure that this is a good approach.
> The idea behind the STROBE LED is that is used for flash light and should
> not be like on/off state, but rather the (quite) short pulse.
> 
> Combining these two together may even overheat the real strobe LED if used.

I agree. If the GPIO is used for a real flash LED, is it better to 
develop a new driver to control it. For example, some cameras need a 
flashlight device "LM3643".

> That said, is that platform using strobe GPIO for the privacy LED for real?!

On my Meteor Lake device, this pin is used for IR camera so actually it 
should control the IR LED. However I still don't know its detail usage. 
It may depends on the Lattice firmware, because I found only the 
handshake pin takes effects now and can't do more experiments. I think 
we should leave it open and I will update when I find something new.
diff mbox series

Patch

diff --git a/drivers/platform/x86/intel/int3472/common.h b/drivers/platform/x86/intel/int3472/common.h
index 9f29baa13860..655ae3ec0593 100644
--- a/drivers/platform/x86/intel/int3472/common.h
+++ b/drivers/platform/x86/intel/int3472/common.h
@@ -19,6 +19,7 @@ 
 /* PMIC GPIO Types */
 #define INT3472_GPIO_TYPE_RESET					0x00
 #define INT3472_GPIO_TYPE_POWERDOWN				0x01
+#define INT3472_GPIO_TYPE_STROBE				0x02
 #define INT3472_GPIO_TYPE_POWER_ENABLE				0x0b
 #define INT3472_GPIO_TYPE_CLK_ENABLE				0x0c
 #define INT3472_GPIO_TYPE_PRIVACY_LED				0x0d
diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c
index e33c2d75975c..b644ce65c990 100644
--- a/drivers/platform/x86/intel/int3472/discrete.c
+++ b/drivers/platform/x86/intel/int3472/discrete.c
@@ -102,6 +102,7 @@  static void int3472_get_func_and_polarity(u8 type, const char **func, u32 *polar
 		*func = "clk-enable";
 		*polarity = GPIO_ACTIVE_HIGH;
 		break;
+	case INT3472_GPIO_TYPE_STROBE:
 	case INT3472_GPIO_TYPE_PRIVACY_LED:
 		*func = "privacy-led";
 		*polarity = GPIO_ACTIVE_HIGH;
@@ -211,6 +212,7 @@  static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
 			err_msg = "Failed to register clock\n";
 
 		break;
+	case INT3472_GPIO_TYPE_STROBE:
 	case INT3472_GPIO_TYPE_PRIVACY_LED:
 		ret = skl_int3472_register_pled(int3472, agpio, polarity);
 		if (ret)