# Re: \[PATCH v2 2/2\] clk: vc5: Add properties for configuring SD/OE behavior

- From: Luca Ceresoli \<luca@lucaceresoli.net\>
- Date: 2021-06-16 15:42:38 
- List: linux-clk
- Page: https://ratatoskr.run/linux-clk/2021/06/8266604
- Thread: https://ratatoskr.run/linux-clk/2021/06/8192062/t.md

```text
Hi Sean,

On 14/06/21 17:54, Sean Anderson wrote:
> The SD/OE pin may be configured to enable output when high or low, and
> to shutdown the device when high. This behavior is controller by the SH
> and SP bits of the Primary Source and Shutdown Register (and to a lesser
> extent the OS and OE bits). By default, both bits are 0, but they may
> need to be configured differently, depending on the external circuitry
> controlling the SD/OE pin.
> 
> Signed-off-by: Sean Anderson <redacted>

Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>

> @@ -914,6 +915,15 @@ static int vc5_probe(struct i2c_client *client, const struct i2c_device_id *id)
>  		return PTR_ERR(vc5->regmap);
>  	}
>  
> +	oe_polarity = of_property_read_bool(client->dev.of_node,
> +					    "idt,output-enable-active-high");
> +	sd_enable = of_property_read_bool(client->dev.of_node,
> +					  "idt,enable-shutdown");
> +	regmap_update_bits(vc5->regmap, VC5_PRIM_SRC_SHDN,
> +			   VC5_PRIM_SRC_SHDN_SP | VC5_PRIM_SRC_SHDN_EN_GBL_SHDN,
> +			   (oe_polarity ? VC5_PRIM_SRC_SHDN_SP : 0)
> +			   | (sd_enable ? VC5_PRIM_SRC_SHDN_EN_GBL_SHDN : 0));
> +

Did you test all combinations?

Thanks,
-- 
Luca
```
