Lines Matching +full:de +full:- +full:asserting
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * i2c-smbus.c - SMBus extensions to the I2C protocol
6 * Copyright (C) 2010-2019 Jean Delvare <jdelvare@suse.de>
13 #include <linux/i2c-smbus.h>
40 if (!client || client->addr != data->addr) in smbus_do_alert()
42 if (client->flags & I2C_CLIENT_TEN) in smbus_do_alert()
50 if (client->dev.driver) { in smbus_do_alert()
51 driver = to_i2c_driver(client->dev.driver); in smbus_do_alert()
52 if (driver->alert) { in smbus_do_alert()
54 driver->alert(client, data->type, data->data); in smbus_do_alert()
55 ret = -EBUSY; in smbus_do_alert()
57 dev_warn(&client->dev, "no driver alert()!\n"); in smbus_do_alert()
58 ret = -EOPNOTSUPP; in smbus_do_alert()
61 dev_dbg(&client->dev, "alert with no driver\n"); in smbus_do_alert()
62 ret = -ENODEV; in smbus_do_alert()
77 if (!client || (client->flags & I2C_CLIENT_TEN)) in smbus_do_alert_force()
85 if (client->dev.driver) { in smbus_do_alert_force()
86 driver = to_i2c_driver(client->dev.driver); in smbus_do_alert_force()
87 if (driver->alert) in smbus_do_alert_force()
88 driver->alert(client, data->type, data->data); in smbus_do_alert_force()
105 ara = alert->ara; in smbus_alert()
114 * responding, an SMBus device stops asserting SMBALERT#. in smbus_alert()
116 * Note that SMBus 2.0 reserves 10-bit addresses for future in smbus_alert()
127 dev_dbg(&ara->dev, "SMBALERT# from dev 0x%02x, flag %d\n", in smbus_alert()
131 status = device_for_each_child(&ara->adapter->dev, &data, in smbus_alert()
144 if (data.addr == prev_addr && status != -EBUSY) { in smbus_alert()
145 device_for_each_child(&ara->adapter->dev, &data, in smbus_alert()
168 struct i2c_smbus_alert_setup *setup = dev_get_platdata(&ara->dev); in smbalert_probe()
170 struct i2c_adapter *adapter = ara->adapter; in smbalert_probe()
175 alert = devm_kzalloc(&ara->dev, sizeof(struct i2c_smbus_alert), in smbalert_probe()
178 return -ENOMEM; in smbalert_probe()
181 irq = setup->irq; in smbalert_probe()
183 irq = fwnode_irq_get_byname(dev_fwnode(adapter->dev.parent), in smbalert_probe()
186 gpiod = devm_gpiod_get(adapter->dev.parent, "smbalert", GPIOD_IN); in smbalert_probe()
198 INIT_WORK(&alert->alert, smbalert_work); in smbalert_probe()
199 alert->ara = ara; in smbalert_probe()
202 res = devm_request_threaded_irq(&ara->dev, irq, NULL, smbus_alert, in smbalert_probe()
209 dev_info(&adapter->dev, "supports SMBALERT#\n"); in smbalert_probe()
219 cancel_work_sync(&alert->alert); in smbalert_remove()
238 * i2c_handle_smbus_alert - Handle an SMBus alert
253 return schedule_work(&alert->alert); in i2c_handle_smbus_alert()
269 struct i2c_slave_host_notify_status *status = client->dev.platform_data; in i2c_slave_host_notify_cb()
277 if (status->index == 0) in i2c_slave_host_notify_cb()
278 status->addr = *val; in i2c_slave_host_notify_cb()
279 if (status->index < U8_MAX) in i2c_slave_host_notify_cb()
280 status->index++; in i2c_slave_host_notify_cb()
283 if (status->index == SMBUS_HOST_NOTIFY_LEN) in i2c_slave_host_notify_cb()
284 i2c_handle_smbus_host_notify(client->adapter, in i2c_slave_host_notify_cb()
285 status->addr); in i2c_slave_host_notify_cb()
288 status->index = 0; in i2c_slave_host_notify_cb()
300 * i2c_new_slave_host_notify_device - get a client for SMBus host-notify support
304 * Setup handling of the SMBus host-notify protocol on a given I2C bus segment.
307 * received via the SMBus host-notify address (0x8)
325 return ERR_PTR(-ENOMEM); in i2c_new_slave_host_notify_device()
347 * i2c_free_slave_host_notify_device - free the client for SMBus host-notify
360 kfree(client->dev.platform_data); in i2c_free_slave_host_notify_device()
370 * - Only works if all filled slots have the same memory type
371 * - Only works for (LP)DDR memory types up to DDR5
372 * - Only works on systems with 1 to 8 memory slots
402 dev_warn(&adap->dev, in i2c_register_spd()
443 dev_info(&adap->dev, in i2c_register_spd()
465 dev_info(&adap->dev, in i2c_register_spd()
468 dimm_count--; in i2c_register_spd()
475 MODULE_AUTHOR("Jean Delvare <jdelvare@suse.de>");