Lines Matching +full:max +full:- +full:bitrate

1 // SPDX-License-Identifier: GPL-2.0
3 * phy-can-transceiver.c - phy driver for CAN transceivers
5 * Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com
34 if (can_transceiver_phy->mux_state) { in can_transceiver_phy_power_on()
35 ret = mux_state_select(can_transceiver_phy->mux_state); in can_transceiver_phy_power_on()
37 dev_err(&phy->dev, "Failed to select CAN mux: %d\n", ret); in can_transceiver_phy_power_on()
41 if (can_transceiver_phy->standby_gpio) in can_transceiver_phy_power_on()
42 gpiod_set_value_cansleep(can_transceiver_phy->standby_gpio, 0); in can_transceiver_phy_power_on()
43 if (can_transceiver_phy->enable_gpio) in can_transceiver_phy_power_on()
44 gpiod_set_value_cansleep(can_transceiver_phy->enable_gpio, 1); in can_transceiver_phy_power_on()
54 if (can_transceiver_phy->standby_gpio) in can_transceiver_phy_power_off()
55 gpiod_set_value_cansleep(can_transceiver_phy->standby_gpio, 1); in can_transceiver_phy_power_off()
56 if (can_transceiver_phy->enable_gpio) in can_transceiver_phy_power_off()
57 gpiod_set_value_cansleep(can_transceiver_phy->enable_gpio, 0); in can_transceiver_phy_power_off()
58 if (can_transceiver_phy->mux_state) in can_transceiver_phy_power_off()
59 mux_state_deselect(can_transceiver_phy->mux_state); in can_transceiver_phy_power_off()
94 struct device *dev = &pdev->dev; in can_transceiver_phy_probe()
105 return -ENOMEM; in can_transceiver_phy_probe()
107 match = of_match_node(can_transceiver_phy_ids, pdev->dev.of_node); in can_transceiver_phy_probe()
108 drvdata = match->data; in can_transceiver_phy_probe()
110 if (of_property_read_bool(dev->of_node, "mux-states")) { in can_transceiver_phy_probe()
115 return dev_err_probe(&pdev->dev, PTR_ERR(mux_state), in can_transceiver_phy_probe()
117 can_transceiver_phy->mux_state = mux_state; in can_transceiver_phy_probe()
120 phy = devm_phy_create(dev, dev->of_node, in can_transceiver_phy_probe()
127 device_property_read_u32(dev, "max-bitrate", &max_bitrate); in can_transceiver_phy_probe()
129 dev_warn(dev, "Invalid value for transceiver max bitrate. Ignoring bitrate limit\n"); in can_transceiver_phy_probe()
130 phy->attrs.max_link_rate = max_bitrate; in can_transceiver_phy_probe()
132 can_transceiver_phy->generic_phy = phy; in can_transceiver_phy_probe()
134 if (drvdata->flags & CAN_TRANSCEIVER_STB_PRESENT) { in can_transceiver_phy_probe()
138 can_transceiver_phy->standby_gpio = standby_gpio; in can_transceiver_phy_probe()
141 if (drvdata->flags & CAN_TRANSCEIVER_EN_PRESENT) { in can_transceiver_phy_probe()
145 can_transceiver_phy->enable_gpio = enable_gpio; in can_transceiver_phy_probe()
148 phy_set_drvdata(can_transceiver_phy->generic_phy, can_transceiver_phy); in can_transceiver_phy_probe()
158 .name = "can-transceiver-phy",
166 MODULE_AUTHOR("Aswath Govindraju <a-govindraju@ti.com>");